rpms/perl/F-12 perl-update-Compress-Raw-Zlib.patch, NONE, 1.1 perl-update-IO-Compress-Zlib.patch, NONE, 1.1 perl-update-IO-Compress-Base.patch, 1.1, 1.2 perl.spec, 1.235, 1.236 perl-update-Compress_Raw_Zlib.patch, 1.1, NONE

Štěpán Kasal kasal at fedoraproject.org
Tue Dec 1 15:15:30 UTC 2009


Author: kasal

Update of /cvs/extras/rpms/perl/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv14830

Modified Files:
	perl-update-IO-Compress-Base.patch perl.spec 
Added Files:
	perl-update-Compress-Raw-Zlib.patch 
	perl-update-IO-Compress-Zlib.patch 
Removed Files:
	perl-update-Compress_Raw_Zlib.patch 
Log Message:
sync with devel

perl-update-Compress-Raw-Zlib.patch:
 MANIFEST                                       |    1 
 ext/Compress/Raw/Zlib/Changes                  |   67 +++++
 ext/Compress/Raw/Zlib/Makefile.PL              |   13 -
 ext/Compress/Raw/Zlib/README                   |   83 ++----
 ext/Compress/Raw/Zlib/Zlib.xs                  |  116 +++++++--
 ext/Compress/Raw/Zlib/lib/Compress/Raw/Zlib.pm |  307 +++++++++++++++++++++----
 ext/Compress/Raw/Zlib/t/02zlib.t               |  157 ++++++++++++
 ext/Compress/Raw/Zlib/t/09limitoutput.t        |  129 ++++++++++
 8 files changed, 728 insertions(+), 145 deletions(-)

--- NEW FILE perl-update-Compress-Raw-Zlib.patch ---
Compress-Raw-Zlib-2.023
(omitting changes to private/MakeUtil.pm)
(omitting changes to perl-5.10.0/t/lib/compress; these are in
IO-Compress-Base 2.015 update)

diff -urN perl-5.10.0.orig/MANIFEST perl-5.10.0/MANIFEST
--- perl-5.10.0.orig/MANIFEST	2009-12-01 14:46:37.000000000 +0100
+++ perl-5.10.0/MANIFEST	2009-12-01 15:43:34.000000000 +0100
@@ -124,6 +124,7 @@
 ext/Compress/Raw/Zlib/t/01version.t	Compress::Raw::Zlib
 ext/Compress/Raw/Zlib/t/02zlib.t	Compress::Raw::Zlib
 ext/Compress/Raw/Zlib/t/07bufsize.t	Compress::Raw::Zlib
+ext/Compress/Raw/Zlib/t/09limitoutput.t	Compress::Raw::Zlib
 ext/Compress/Raw/Zlib/t/18lvalue.t	Compress::Raw::Zlib
 ext/Compress/Raw/Zlib/typemap		Compress::Raw::Zlib
 ext/Compress/Raw/Zlib/zlib-src/adler32.c	Compress::Raw::Zlib
diff -urN perl-5.10.0.orig/ext/Compress/Raw/Zlib/Changes perl-5.10.0/ext/Compress/Raw/Zlib/Changes
--- perl-5.10.0.orig/ext/Compress/Raw/Zlib/Changes	2009-12-01 15:36:07.000000000 +0100
+++ perl-5.10.0/ext/Compress/Raw/Zlib/Changes	2009-12-01 15:38:24.000000000 +0100
@@ -1,6 +1,73 @@
 CHANGES
 -------
 
+  2.023 9 November 2009
+
+      * fixed instance where $[ should have been $] in t/02zlib.t
+        Thanks to Robin Barker and zefram [RT #50765] for independantly
+        spotting the issue.
+
+  2.021 30 August 2009
+
+      * Changed test harness so that it can cope with PERL5OPT=-MCarp=verbose
+        [RT# 47225]
+
+  2.020 3 June 2009
+
+      * Minor documentation update.
+
+  2.019 4 May 2009
+
+      * No Changes
+
+  2.018 3 May 2009
+
+      * No Changes
+
+  2.017 28 March 2009
+
+      * Added 'LimitOutput' option
+
+      * Removed MAN3PODS from Makefile.PL
+
+      * Fixed coring issue when LimitOutput was used.
+
+      * Documented Compress::Raw::Zlib::zlib_version()
+
+      * Documented Compress::Raw::Zlib::deflateReset()
+        [RT #40566]
+
+  2.015 3 September 2008
+
+      * Makefile.PL
+        Backout changes made in 2.014
+
+  2.014 2 September 2008
+
+      * Makefile.PL
+        Updated to check for indirect dependencies.
+
+  2.012 15 July 2008
+
+      * Document the gzip flags that WindowBits can take.
+
+      * Allow a dictionary to be used with a raw inflate. 
+        Needs zlib 1.2.2.1 or better.
+        [RT #36046]
+      
+  2.011 5 May 2008
+
+      * A C++-style comment sneaked in with the last update. Fixed.
+        [core patch #33828]
+
+  2.010 5 May 2008
+
+      * No Changes
+
+  2.009 20 April 2008
+
+      * No Changes
+
   2.008 2 November 2007
 
       * Minor documentation changes in README
diff -urN perl-5.10.0.orig/ext/Compress/Raw/Zlib/Makefile.PL perl-5.10.0/ext/Compress/Raw/Zlib/Makefile.PL
--- perl-5.10.0.orig/ext/Compress/Raw/Zlib/Makefile.PL	2009-12-01 14:47:16.000000000 +0100
+++ perl-5.10.0/ext/Compress/Raw/Zlib/Makefile.PL	2009-12-01 15:38:24.000000000 +0100
@@ -77,24 +77,11 @@
                     },
 
     (
-      $ENV{SKIP_FOR_CORE}
-        ? (MAN3PODS    => {})
-        : ()
-    ),
-       
-    (
       $BUILD_ZLIB
         ? zlib_files($ZLIB_LIB)
         : (LIBS => [ "-L$ZLIB_LIB -lz " ])
     ),
       
-    (
-      $] >= 5.005
-        ? (ABSTRACT_FROM => 'lib/Compress/Raw/Zlib.pm',
-            AUTHOR       => 'Paul Marquess <pmqs at cpan.org>')
-        : ()
-    ),
-
     INSTALLDIRS => ($] >= 5.009 ? 'perl' : 'site'),
 
     ((ExtUtils::MakeMaker->VERSION() gt '6.30') ?
diff -urN perl-5.10.0.orig/ext/Compress/Raw/Zlib/README perl-5.10.0/ext/Compress/Raw/Zlib/README
--- perl-5.10.0.orig/ext/Compress/Raw/Zlib/README	2009-12-01 15:36:07.000000000 +0100
+++ perl-5.10.0/ext/Compress/Raw/Zlib/README	2009-12-01 15:38:24.000000000 +0100
@@ -1,16 +1,14 @@
 
                              Compress-Raw-Zlib
 
-                             Version 2.008
+                             Version 2.023
 
-                             2nd November 2007
+                             9th November 2009
 
-
-       Copyright (c) 2005-2007 Paul Marquess. All rights reserved.
+       Copyright (c) 2005-2009 Paul Marquess. All rights reserved.
           This program is free software; you can redistribute it
            and/or modify it under the same terms as Perl itself.
 
-
               The directory zlib-src contains a subset of the 
              source files copied directly from zlib version 1.2.3.
                   These files are Copyright(C) 1995-2005
@@ -18,39 +16,27 @@
              Full source for the zlib library is available at
                             http://www.zlib.org
 
-
-
 DESCRIPTION
 -----------
 
-
 This module provides a Perl interface to the zlib compression library.  
 
-
-
-
-
 PREREQUISITES
 -------------
 
 Before you can build Compress-Raw-Zlib you need to have the following
 installed on your system:
 
-
     * A C compiler
 
     * Perl 5.004 or better. 
 
-
-
 By default, Compress-Raw-Zlib will build its own private copy of the 
 zlib library. If you want to use a different version of 
 zlib, follow the instructions in the section called 
 "Controlling the version of zlib used by Compress-Raw-Zlib" 
 later in this document.
 
-
-
 BUILDING THE MODULE
 -------------------
 
@@ -61,8 +47,6 @@
     make
     make test
 
-
-
 INSTALLATION
 ------------
 
@@ -70,9 +54,6 @@
 
     make install
 
-
-
-
 Controlling the version of zlib used by Compress-Raw-Zlib 
 ----------------------------------------------------------
 
@@ -92,7 +73,6 @@
 Note that if you intend to use either Option 2 or 3, you need to have
 zlib version 1.0.5 or better.
 
-
 The contents of the file config.in are used to control which of the
 three options is actually used. This file is read during the
 
@@ -101,8 +81,6 @@
 step of the build, so remember to make any required changes to config.in
 before building this module.
 
-
-
   Option 1
   --------
   
@@ -169,10 +147,9 @@
 ------------------------
 
 Every gzip stream stores a byte in its header to identify the Operating
-System that was used to create the gzip stream. When you build
-Compress-Raw-Zlib it will attempt to determine the value that is correct for
-your Operating System. This will then be used by IO::Gzip as the default
-value for the OS byte in all gzip headers it creates. 
+System that was used to create the gzip stream. When you build Compress-Raw-Zlib it will attempt to determine the value that is correct for
+your Operating System. This will then be used by IO::Compress::Gzip as the
+default value for the OS byte in all gzip headers it creates. 
  
 The variable GZIP_OS_CODE in the config.in file controls the setting of
 this value when building Compress-Raw-Zlib. If GZIP_OS_CODE is set to
@@ -197,16 +174,37 @@
 detected is incorrect, please take a few moments to contact the author of
 this module.
 
-
-
 TROUBLESHOOTING
 ---------------
 
+Undefined Symbol gzsetparams
+----------------------------
 
+If you get the error shown below when you run the Compress-Raw-Zlib test
+harness it probably means you are running a copy of zlib that is
+version 1.0.5 or older.
 
+t/01version.........Can't load 'blib/arch/auto/Compress/Zlib/Zlib.so' for 
+                    module Compress::Raw::Zlib: blib/arch/auto/Compress/Raw/Zlib/Zlib.so:
+                    undefined symbol: gzsetparams at ...
 
+There are two ways to fix this problem:
 
+    1. Upgrade to the latest version of zlib.
 
+    2. Edit config.in and set the OLD_ZLIB variable to True.
+
+Test Harness 01version fails
+----------------------------
+If the 01version test harness fails, and the problem isn't covered by the
+scenario above, it probably means that you have two versions of 
+zlib installed on your system.
+
+Run the command below to see if this is indeed the case
+
+    make test TEST_VERBOSE=1 TEST_FILES=t/01version.t 
+
+Try removing the one you don't want to use and rebuild.   
 
 Solaris build fails with "language optional software package not installed"
 ---------------------------------------------------------------------------
@@ -245,9 +243,6 @@
 If that doesn't work for you, it's time to make changes to the Makefile
 by hand. Good luck!
 
-
-
-
 Solaris build fails with "gcc: unrecognized option `-KPIC'"
 -----------------------------------------------------------
 
@@ -285,10 +280,6 @@
 is necessary to have first built the zlib library with the -fpic
 option.
 
-
-
-
-
 Linux Notes
 -----------
 
@@ -307,9 +298,6 @@
 for zlib. Check for an RPM that start with "zlib-devel" in your Linux
 distribution.
 
-
-
-
 Win32 Notes
 -----------
 
@@ -318,15 +306,11 @@
 newer version of Compress-Raw-Zlib is available run this from the command
 prompt
 
-    C:\> ppm verify -upgrade Compress-Zlib
-
+    C:\> ppm verify -upgrade Compress-Raw-Zlib
 
 If you are not running Activestate Perl and you don't have access
 to a C compiler, you will not be able to build and install this module.
 
-
-
-
 Win32 & Cygwin Notes
 --------------------
 
@@ -338,7 +322,6 @@
 The workaround is to install Compress-Raw-Zlib manually using the
 instructions given at the start of this file.
 
-
 FEEDBACK
 --------
 
@@ -372,8 +355,7 @@
         If you haven't installed Compress-Raw-Zlib then search Compress::Raw::Zlib.pm
         for a line like this:
 
-          $VERSION = "2.008" ;
-
+          $VERSION = "2.023" ;
 
      c. The version of zlib you have used.
         If you have successfully installed Compress-Raw-Zlib, this one-liner
@@ -381,10 +363,8 @@
 
           perl -MCompress::Raw::Zlib -e "print q[zlib ver ]. Compress::Raw::Zlib::ZLIB_VERSION.qq[\n]" 
 
-
         If not, look at the beginning of the file zlib.h. 
 
-
  2. If you are having problems building Compress-Raw-Zlib, send me a
     complete log of what happened. Start by unpacking the Compress-Raw-Zlib
     module into a fresh directory and keep a log of all the steps
@@ -394,5 +374,4 @@
         make
         make test TEST_VERBOSE=1          
 
-
 Paul Marquess <pmqs at cpan.org>
diff -urN perl-5.10.0.orig/ext/Compress/Raw/Zlib/Zlib.xs perl-5.10.0/ext/Compress/Raw/Zlib/Zlib.xs
--- perl-5.10.0.orig/ext/Compress/Raw/Zlib/Zlib.xs	2009-12-01 15:36:07.000000000 +0100
+++ perl-5.10.0/ext/Compress/Raw/Zlib/Zlib.xs	2009-12-01 15:38:24.000000000 +0100
@@ -3,7 +3,7 @@
  * Created : 22nd January 1996
  * Version : 2.000
  *
- *   Copyright (c) 1995-2007 Paul Marquess. All rights reserved.
+ *   Copyright (c) 1995-2009 Paul Marquess. All rights reserved.
  *   This program is free software; you can redistribute it and/or
  *   modify it under the same terms as Perl itself.
  *
@@ -50,6 +50,10 @@
 #  define AT_LEAST_ZLIB_1_2_2_1
 #endif
 
+#if  defined(ZLIB_VERNUM) && ZLIB_VERNUM >= 0x1222
+#  define AT_LEAST_ZLIB_1_2_2_2
+#endif
+
 #if  defined(ZLIB_VERNUM) && ZLIB_VERNUM >= 0x1223
 #  define AT_LEAST_ZLIB_1_2_2_3
 #endif
@@ -64,6 +68,11 @@
 #  include "ppport.h"
 #endif
 
+#if PERL_REVISION == 5 && PERL_VERSION == 9
+    /* For Andreas */
+#   define sv_pvbyte_force(sv,lp) sv_pvbyten_force(sv,lp)
+#endif
+
 #if PERL_REVISION == 5 && (PERL_VERSION < 8 || (PERL_VERSION == 8 && PERL_SUBVERSION < 4 ))
 
 #    ifdef SvPVbyte_force
@@ -103,6 +112,7 @@
 #define FLAG_CRC32              2
 #define FLAG_ADLER32            4
 #define FLAG_CONSUME_INPUT      8
+#define FLAG_LIMIT_OUTPUT       16
     uLong    crc32 ;
     uLong    adler32 ;
     z_stream stream;
@@ -228,7 +238,8 @@
 #define adlerInitial adler32(0L, Z_NULL, 0)
 #define crcInitial crc32(0L, Z_NULL, 0)
 
-static const char * const my_z_errmsg[] = {
+/* static const char * const my_z_errmsg[] = { */
+static const char my_z_errmsg[][32] = {
     "need dictionary",     /* Z_NEED_DICT     2 */
     "stream end",          /* Z_STREAM_END    1 */
     "",                    /* Z_OK            0 */
@@ -460,6 +471,8 @@
         printf("           CRC32     %s\n",   EnDis(FLAG_CRC32));
         printf("           ADLER32   %s\n",   EnDis(FLAG_ADLER32));
         printf("           CONSUME   %s\n",   EnDis(FLAG_CONSUME_INPUT));
+        printf("           LIMIT     %s\n",   EnDis(FLAG_LIMIT_OUTPUT));
+
 
 #ifdef MAGIC_APPEND
         printf("    window           0x%p\n", s->window);
@@ -510,7 +523,7 @@
 
 static SV* 
 #ifdef CAN_PROTOTYPE
-deRef(SV * sv, char * string)
+deRef(SV * sv, const char * string)
 #else
 deRef(sv, string)
 SV * sv ;
@@ -528,6 +541,8 @@
             case SVt_PVHV:
             case SVt_PVCV:
                 croak("%s: buffer parameter is not a SCALAR reference", string);
+            default:
+                break;
         }
         if (SvROK(sv))
             croak("%s: buffer parameter is a reference to a reference", string) ;
@@ -542,7 +557,7 @@
 
 static SV*
 #ifdef CAN_PROTOTYPE
-deRef_l(SV * sv, char * string)
+deRef_l(SV * sv, const char * string)
 #else
 deRef_l(sv, string)
 SV * sv ;
@@ -565,6 +580,8 @@
             case SVt_PVHV:
             case SVt_PVCV:
                 croak("%s: buffer parameter is not a SCALAR reference", string);
+            default:
+                break;
         }
         if (SvROK(sv))
             croak("%s: buffer parameter is a reference to a reference", string) ;
@@ -802,6 +819,19 @@
             s = NULL ;
 	}
 	else if (SvCUR(dictionary)) {
+#ifdef AT_LEAST_ZLIB_1_2_2_1
+        /* Zlib 1.2.2.1 or better allows a dictionary with raw inflate */
+        if (s->WindowBits < 0) {
+            err = inflateSetDictionary(&(s->stream), 
+                (const Bytef*)SvPVbyte_nolen(dictionary),
+                SvCUR(dictionary));
+            if (err != Z_OK) {
+                Safefree(s) ;
+                s = NULL ;
+            }
+        }
+        else
+#endif   
             /* Dictionary specified - take a copy for use in inflate */
 	    s->dictionary = newSVsv(dictionary) ;
 	}
@@ -1246,7 +1276,7 @@
     bool 	eof 
     uInt	cur_length = 0;
     uInt	prefix_length = 0;
-    uInt	increment = 0;
+    int	    increment = 0;
     STRLEN  stmp    = NO_INIT
     uLong     bufinc = NO_INIT
   PREINIT:
@@ -1280,22 +1310,39 @@
     if((s->flags & FLAG_APPEND) != FLAG_APPEND) {
         SvCUR_set(output, 0);
     }
+   
+    /* Assume no output buffer - the code below will update if there is any available */
+    s->stream.avail_out = 0;
+
+
     if (SvLEN(output)) {
         prefix_length = cur_length =  SvCUR(output) ;
-        s->stream.next_out = (Bytef*) SvPVbyte_nolen(output) + cur_length;
-        increment = SvLEN(output) -  cur_length - 1;
-        s->stream.avail_out = increment;
-    }
-    else {
-        s->stream.avail_out = 0;
+    
+        if (s->flags & FLAG_LIMIT_OUTPUT && SvLEN(output) - cur_length - 1 < bufinc)
+        {
+            Sv_Grow(output, bufinc + cur_length + 1) ;
+        }
+    
+        /* Only setup the stream output pointers if there is spare 
+           capacity in the outout SV
+        */
+        if (SvLEN(output) > cur_length + 1)
+        {
+            s->stream.next_out = (Bytef*) SvPVbyte_nolen(output) + cur_length;
+            increment = SvLEN(output) -  cur_length - 1;
+            s->stream.avail_out = increment;
+        }
     }
+    
+
     s->bytesInflated = 0;
     
-    while (1) {
+    RETVAL = Z_OK;
 
-        if (s->stream.avail_out == 0 ) {
+    while (RETVAL == Z_OK) {
+        if (s->stream.avail_out == 0) {
 	    /* out of space in the output buffer so make it bigger */
-            Sv_Grow(output, SvLEN(output) + bufinc) ;
+            Sv_Grow(output, SvLEN(output) + bufinc +1) ;
             cur_length += increment ;
             s->stream.next_out = (Bytef*) SvPVbyte_nolen(output) + cur_length ;
             increment = bufinc ;
@@ -1303,10 +1350,30 @@
             bufinc *= 2 ; 
         }
 
+        /* printf("INFLATE Availl In %d, Out %d\n", s->stream.avail_in,
+ s->stream.avail_out); 
+DispStream(s, "BEFORE");
+Perl_sv_dump(output); */
         RETVAL = inflate(&(s->stream), Z_SYNC_FLUSH);
+        /* printf("INFLATE returned %d %s, avail in %d, out %d\n", RETVAL,
+ GetErrorString(RETVAL), s->stream.avail_in, s->stream.avail_out); */
+
+    
+        if (RETVAL == Z_NEED_DICT && s->dictionary) {
+            s->dict_adler = s->stream.adler ;
+            RETVAL = inflateSetDictionary(&(s->stream), 
+            (const Bytef*)SvPVbyte_nolen(s->dictionary),
+            SvCUR(s->dictionary));
+            if (RETVAL == Z_OK)
+                continue;
+        }
+        
+        if (s->flags & FLAG_LIMIT_OUTPUT && 
+                (RETVAL == Z_OK || RETVAL == Z_BUF_ERROR ))
+            break;
 
         if (RETVAL == Z_STREAM_ERROR || RETVAL == Z_MEM_ERROR ||
-            RETVAL == Z_DATA_ERROR  || RETVAL == Z_STREAM_END )
+            RETVAL == Z_DATA_ERROR   || RETVAL == Z_STREAM_END )
             break ;
 
         if (RETVAL == Z_BUF_ERROR) {
@@ -1317,19 +1384,9 @@
                 break ;
             }
         }
-	
-        if (RETVAL == Z_NEED_DICT && s->dictionary) {
-            s->dict_adler = s->stream.adler ;
-            RETVAL = inflateSetDictionary(&(s->stream), 
-            (const Bytef*)SvPVbyte_nolen(s->dictionary),
-            SvCUR(s->dictionary));
-        }
-
-        if (RETVAL != Z_OK) 
-            break;
     }
 #ifdef NEED_DUMMY_BYTE_AT_END 
-    if (eof && RETVAL == Z_OK) {
+    if (eof && RETVAL == Z_OK && s->flags & FLAG_LIMIT_OUTPUT == 0) {
         Bytef* nextIn =  s->stream.next_in;
         uInt availIn =  s->stream.avail_in;
         s->stream.next_in = (Bytef*) " ";
@@ -1350,8 +1407,8 @@
 #endif
     
     s->last_error = RETVAL ;
-    if (RETVAL == Z_OK || RETVAL == Z_STREAM_END || RETVAL == Z_DATA_ERROR) {
-	unsigned in ;
+    if (RETVAL == Z_OK || RETVAL == Z_STREAM_END || RETVAL == Z_BUF_ERROR || RETVAL == Z_DATA_ERROR) {
+	   unsigned in ;
 
         s->bytesInflated = cur_length + increment - s->stream.avail_out - prefix_length;
         s->uncompressedBytes += s->bytesInflated ;
@@ -1377,7 +1434,7 @@
             			SvCUR(output)-prefix_length) ;
 
 	/* fix the input buffer */
-	if (s->flags & FLAG_CONSUME_INPUT) {
+	if (s->flags & FLAG_CONSUME_INPUT || s->flags & FLAG_LIMIT_OUTPUT) {
 	    in = s->stream.avail_in ;
 	    SvCUR_set(buf, in) ;
 	    if (in)
@@ -1385,6 +1442,7 @@
             *SvEND(buf) = '\0';
             SvSETMAGIC(buf);
 	}
+
     }
     OUTPUT:
 	RETVAL
diff -urN perl-5.10.0.orig/ext/Compress/Raw/Zlib/lib/Compress/Raw/Zlib.pm perl-5.10.0/ext/Compress/Raw/Zlib/lib/Compress/Raw/Zlib.pm
--- perl-5.10.0.orig/ext/Compress/Raw/Zlib/lib/Compress/Raw/Zlib.pm	2009-12-01 15:36:07.000000000 +0100
+++ perl-5.10.0/ext/Compress/Raw/Zlib/lib/Compress/Raw/Zlib.pm	2009-12-01 15:38:24.000000000 +0100
@@ -13,7 +13,7 @@
 use bytes ;
 our ($VERSION, $XS_VERSION, @ISA, @EXPORT, $AUTOLOAD);
 
-$VERSION = '2.008';
+$VERSION = '2.023';
 $XS_VERSION = $VERSION; 
 $VERSION = eval $VERSION;
 
@@ -62,8 +62,13 @@
         Z_SYNC_FLUSH
         Z_UNKNOWN
         Z_VERSION_ERROR
+
+        WANT_GZIP
+        WANT_GZIP_OR_ZLIB
 );
 
+use constant WANT_GZIP           => 16;
+use constant WANT_GZIP_OR_ZLIB   => 32;
 
 sub AUTOLOAD {
     my($constname);
@@ -79,6 +84,7 @@
 use constant FLAG_CRC                => 2 ;
 use constant FLAG_ADLER              => 4 ;
 use constant FLAG_CONSUME_INPUT      => 8 ;
+use constant FLAG_LIMIT_OUTPUT       => 16 ;
 
 eval {
     require XSLoader;
@@ -361,10 +367,14 @@
     $flags |= FLAG_CRC    if $got->value('CRC32') ;
     $flags |= FLAG_ADLER  if $got->value('ADLER32') ;
 
+    my $windowBits =  $got->value('WindowBits');
+    $windowBits += MAX_WBITS()
+        if ($windowBits & MAX_WBITS()) == 0 ;
+
     _deflateInit($flags,
                 $got->value('Level'), 
                 $got->value('Method'), 
-                $got->value('WindowBits'), 
+                $windowBits, 
                 $got->value('MemLevel'), 
                 $got->value('Strategy'), 
                 $got->value('Bufsize'),
@@ -378,6 +388,7 @@
     my ($got) = ParseParameters(0,
                     {
                         'AppendOutput'  => [1, 1, Parse_boolean,  0],
+                        'LimitOutput'   => [1, 1, Parse_boolean,  0],
                         'CRC32'         => [1, 1, Parse_boolean,  0],
                         'ADLER32'       => [1, 1, Parse_boolean,  0],
                         'ConsumeInput'  => [1, 1, Parse_boolean,  1],
@@ -397,8 +408,14 @@
     $flags |= FLAG_CRC    if $got->value('CRC32') ;
     $flags |= FLAG_ADLER  if $got->value('ADLER32') ;
     $flags |= FLAG_CONSUME_INPUT if $got->value('ConsumeInput') ;
+    $flags |= FLAG_LIMIT_OUTPUT if $got->value('LimitOutput') ;
+
+
+    my $windowBits =  $got->value('WindowBits');
+    $windowBits += MAX_WBITS()
+        if ($windowBits & MAX_WBITS()) == 0 ;
 
-    _inflateInit($flags, $got->value('WindowBits'), $got->value('Bufsize'), 
+    _inflateInit($flags, $windowBits, $got->value('Bufsize'), 
                  $got->value('Dictionary')) ;
 }
 
@@ -530,6 +547,7 @@
     ($d, $status) = new Compress::Raw::Zlib::Deflate( [OPT] ) ;
     $status = $d->deflate($input, $output) ;
     $status = $d->flush($output [, $flush_type]) ;
+    $d->deflateReset() ;
     $d->deflateParams(OPTS) ;
     $d->deflateTune(OPTS) ;
     $d->dict_adler() ;
@@ -559,8 +577,7 @@
     $crc = adler32_combine($crc1, $crc2, $len2)l
     $crc = crc32_combine($adler1, $adler2, $len2)
 
-    ZLIB_VERSION
-    ZLIB_VERNUM
+    my $version = Compress::Raw::Zlib::zlib_version();
 
 =head1 DESCRIPTION
 
@@ -568,8 +585,6 @@
 compression library (see L</AUTHOR> for details about where to get
 I<zlib>). 
 
-
-
 =head1 Compress::Raw::Zlib::Deflate
 
 This section defines an interface that allows in-memory compression using
@@ -577,7 +592,6 @@
 
 Here is a definition of the interface available:
 
-
 =head2 B<($d, $status) = new Compress::Raw::Zlib::Deflate( [OPT] ) >
 
 Initialises a deflation object. 
@@ -610,7 +624,7 @@
 C<Z_NO_COMPRESSION>, C<Z_BEST_SPEED>, C<Z_BEST_COMPRESSION>, and
 C<Z_DEFAULT_COMPRESSION>.
 
-The default is Z_DEFAULT_COMPRESSION.
+The default is C<Z_DEFAULT_COMPRESSION>.
 
 =item B<-Method>
 
@@ -619,10 +633,18 @@
 
 =item B<-WindowBits>
 
+To compress an RFC 1950 data stream, set C<WindowBits> to a positive
+number between 8 and 15.
+
+To compress an RFC 1951 data stream, set C<WindowBits> to C<-MAX_WBITS>.
+
+To compress an RFC 1952 data stream (i.e. gzip), set C<WindowBits> to
+C<WANT_GZIP>.
+
 For a definition of the meaning and valid values for C<WindowBits>
 refer to the I<zlib> documentation for I<deflateInit2>.
 
-Defaults to MAX_WBITS.
+Defaults to C<MAX_WBITS>.
 
 =item B<-MemLevel>
 
@@ -678,7 +700,6 @@
 
 This option defaults to false.
 
-
 =item B<-ADLER32>
 
 If set to true, an adler32 checksum of the uncompressed data will be
@@ -686,7 +707,6 @@
 
 This option defaults to false.
 
-
 =back
 
 Here is an example of using the C<Compress::Raw::Zlib::Deflate> optional
@@ -696,7 +716,6 @@
     my $d = new Compress::Raw::Zlib::Deflate ( -Bufsize => 300, 
                                                -Level   => Z_BEST_SPEED ) ;
 
-
 =head2 B<$status = $d-E<gt>deflate($input, $output)>
 
 Deflates the contents of C<$input> and writes the compressed data to
@@ -744,6 +763,16 @@
 it is false, C<$output> will be truncated before any compressed data is
 written to it.
 
+=head2 B<$status = $d-E<gt>deflateReset() >
+
+This method will reset the deflation object C<$d>. It can be used when you
+are compressing multiple data streams and want to use the same object to
+compress each of them. It should only be used once the previous data stream
+has been flushed successfully, i.e. a call to C<< $d->flush(Z_FINISH) >> has
+returned C<Z_OK>.
+
+Returns C<Z_OK> if successful.
+
 =head2 B<$status = $d-E<gt>deflateParams([OPT])>
 
 Change settings for the deflate object C<$d>.
@@ -751,7 +780,6 @@
 The list of the valid options is shown below. Options not specified
 will remain unchanged.
 
-
 =over 5
 
 =item B<-Level>
@@ -772,7 +800,6 @@
 reallocated to increase the size, it will grow in increments of
 C<Bufsize>.
 
-
 =back
 
 =head2 B<$status = $d-E<gt>deflateTune($good_length, $max_lazy, $nice_length, $max_chain)>
@@ -815,7 +842,6 @@
 Returns the deflation strategy currently used. Valid values are
 C<Z_DEFAULT_STRATEGY>, C<Z_FILTERED> and C<Z_HUFFMAN_ONLY>. 
 
-
 =head2 B<$d-E<gt>get_Level()>
 
 Returns the compression level being used. 
@@ -826,7 +852,6 @@
 
 =head2 Example
 
-
 Here is a trivial example of using C<deflate>. It simply reads standard
 input, deflates it and writes it to standard output.
 
@@ -865,7 +890,6 @@
 
 Here is a definition of the interface:
 
-
 =head2 B< ($i, $status) = new Compress::Raw::Zlib::Inflate( [OPT] ) >
 
 Initialises an inflation object. 
@@ -894,14 +918,20 @@
 =item B<-WindowBits>
 
 To uncompress an RFC 1950 data stream, set C<WindowBits> to a positive
-number.
+number between 8 and 15.
 
 To uncompress an RFC 1951 data stream, set C<WindowBits> to C<-MAX_WBITS>.
 
+To uncompress an RFC 1952 data stream (i.e. gzip), set C<WindowBits> to
+C<WANT_GZIP>.
+
+To auto-detect and uncompress an RFC 1950 or RFC 1952 data stream (i.e.
+gzip), set C<WindowBits> to C<WANT_GZIP_OR_ZLIB>.
+
 For a full definition of the meaning and valid values for C<WindowBits>
 refer to the I<zlib> documentation for I<inflateInit2>.
 
-Defaults to MAX_WBITS.
+Defaults to C<MAX_WBITS>.
 
 =item B<-Bufsize>
 
@@ -928,7 +958,6 @@
 
 This option defaults to false.
 
-
 =item B<-CRC32>
 
 If set to true, a crc32 checksum of the uncompressed data will be
@@ -946,7 +975,7 @@
 =item B<-ConsumeInput>
 
 If set to true, this option will remove compressed data from the input
-buffer of the the C< $i-E<gt>inflate > method as the inflate progresses.
+buffer of the C<< $i->inflate >> method as the inflate progresses.
 
 This option can be useful when you are processing compressed data that is
 embedded in another file/buffer. In this case the data that immediately
@@ -954,6 +983,29 @@
 
 This option defaults to true.
 
+=item B<-LimitOutput>
+
+The C<LimitOutput> option changes the behavior of the C<< $i->inflate >>
+method so that the amount of memory used by the output buffer can be
+limited. 
+
+When C<LimitOutput> is used the size of the output buffer used will either
+be the value of the C<Bufsize> option or the amount of memory already
+allocated to C<$output>, whichever is larger. Predicting the output size
+available is tricky, so don't rely on getting an exact output buffer size.
+
+When C<LimitOutout> is not specified C<< $i->inflate >> will use as much
+memory as it takes to write all the uncompressed data it creates by
+uncompressing the input buffer.
+
+If C<LimitOutput> is enabled, the C<ConsumeInput> option will also be
+enabled.
+
+This option defaults to false.
+
+See L</The LimitOutput option> for a discussion on why C<LimitOutput> is
+needed and how to use it.
+
 =back
 
 Here is an example of using an optional parameter to override the default
@@ -1048,7 +1100,6 @@
 data streams. They must have been added explicitly when the data stream
 was created by calling C<Compress::Deflate::flush>  with C<Z_FULL_FLUSH>.
 
-
 =head2 B<$i-E<gt>dict_adler()>
 
 Returns the adler32 value for the dictionary.
@@ -1083,7 +1134,7 @@
 
 Returns the buffer size used to carry out the decompression.
 
-=head2 Example
+=head2 Examples
 
 Here is an example of using C<inflate>.
 
@@ -1102,10 +1153,9 @@
     my ($output, $status) ;
     while (read(STDIN, $input, 4096))
     {
-        $status = $x->inflate(\$input, $output) ;
+        $status = $x->inflate($input, $output) ;
     
-        print $output 
-            if $status == Z_OK or $status == Z_STREAM_END ;
+        print $output ;
     
         last if $status != Z_OK ;
     }
@@ -1113,6 +1163,46 @@
     die "inflation failed\n"
         unless $status == Z_STREAM_END ;
 
+The next example show how to use the C<LimitOutput> option. Notice the use
+of two nested loops in this case. The outer loop reads the data from the
+input source - STDIN and the inner loop repeatedly calls C<inflate> until
+C<$input> is exhausted, we get an error, or the end of the stream is
+reached. One point worth remembering is by using the C<LimitOutput> option
+you also get C<ConsumeInput> set as well - this makes the code below much
+simpler.
+
+    use strict ;
+    use warnings ;
+    
+    use Compress::Raw::Zlib;
+    
+    my $x = new Compress::Raw::Zlib::Inflate(LimitOutput => 1)
+       or die "Cannot create a inflation stream\n" ;
+    
+    my $input = '' ;
+    binmode STDIN;
+    binmode STDOUT;
+    
+    my ($output, $status) ;
+
+  OUTER:
+    while (read(STDIN, $input, 4096))
+    {
+        do
+        {
+            $status = $x->inflate($input, $output) ;
+
+            print $output ;
+
+            last OUTER
+                unless $status == Z_OK || $status == Z_BUF_ERROR ;
+        }
+        while ($status == Z_OK && length $input);
+    }
+    
+    die "inflation failed\n"
+        unless $status == Z_STREAM_END ;
+
 =head1 CHECKSUM FUNCTIONS
 
 Two functions are provided by I<zlib> to calculate checksums. For the
@@ -1135,24 +1225,163 @@
 
 These functions allow checksums to be merged.
 
-=head1 ACCESSING ZIP FILES
+=head1 Misc
+
+=head2 my $version = Compress::Raw::Zlib::zlib_version();
+
+Returns the version of the zlib library.
+
+=head1 The LimitOutput option.
+
+By default C<< $i->inflate($input, $output) >> will uncompress I<all> data
+in C<$input> and write I<all> of the uncompressed data it has generated to
+C<$output>. This makes the interface to C<inflate> much simpler - if the
+method has uncompressed C<$input> successfully I<all> compressed data in
+C<$input> will have been dealt with. So if you are reading from an input
+source and uncompressing as you go the code will look something like this
+
+    use strict ;
+    use warnings ;
+    
+    use Compress::Raw::Zlib;
+    
+    my $x = new Compress::Raw::Zlib::Inflate()
+       or die "Cannot create a inflation stream\n" ;
+    
+    my $input = '' ;
+    
+    my ($output, $status) ;
+    while (read(STDIN, $input, 4096))
+    {
+        $status = $x->inflate($input, $output) ;
+    
+        print $output ;
+    
+        last if $status != Z_OK ;
+    }
+    
+    die "inflation failed\n"
+        unless $status == Z_STREAM_END ;
+
+The points to note are 
+
+=over 5
+
+=item *
+
+The main processing loop in the code handles reading of compressed data
+from STDIN.
+
+=item *
+
+The status code returned from C<inflate> will only trigger termination of
+the main processing loop if it isn't C<Z_OK>. When C<LimitOutput> has not
+been used the C<Z_OK> status means means that the end of the compressed
+data stream has been reached or there has been an error in uncompression.
+
+=item *
+
+After the call to C<inflate> I<all> of the uncompressed data in C<$input>
+will have been processed. This means the subsequent call to C<read> can
+overwrite it's contents without any problem.
+
+=back
+
+For most use-cases the behavior described above is acceptable (this module
+and it's predecessor, C<Compress::Zlib>, have used it for over 10 years
+without an issue), but in a few very specific use-cases the amount of
+memory required for C<$output> can prohibitively large. For example, if the
+compressed data stream contains the same pattern repeated thousands of
+times, a relatively small compressed data stream can uncompress into
+hundreds of megabytes.  Remember C<inflate> will keep allocating memory
+until I<all> the uncompressed data has been written to the output buffer -
+the size of C<$output> is unbounded. 
+
+The C<LimitOutput> option is designed to help with this use-case.
+
+The main difference in your code when using C<LimitOutput> is having to
+deal with cases where the C<$input> parameter still contains some
+uncompressed data that C<inflate> hasn't processed yet. The status code
+returned from C<inflate> will be C<Z_OK> if uncompression took place and
+C<Z_BUF_ERROR> if the output buffer is full.
+
+Below is typical code that shows how to use C<LimitOutput>.
+
+    use strict ;
+    use warnings ;
+    
+    use Compress::Raw::Zlib;
+    
+    my $x = new Compress::Raw::Zlib::Inflate(LimitOutput => 1)
+       or die "Cannot create a inflation stream\n" ;
+    
+    my $input = '' ;
+    binmode STDIN;
+    binmode STDOUT;
+    
+    my ($output, $status) ;
+
+  OUTER:
+    while (read(STDIN, $input, 4096))
+    {
+        do
+        {
+            $status = $x->inflate($input, $output) ;
 
-Although it is possible (with some effort on your part) to use this
-module to access .zip files, there is a module on CPAN that will do all
-the hard work for you. Check out the C<Archive::Zip> module on CPAN at
+            print $output ;
 
-    http://www.cpan.org/modules/by-module/Archive/Archive-Zip-*.tar.gz    
+            last OUTER
+                unless $status == Z_OK || $status == Z_BUF_ERROR ;
+        }
+        while ($status == Z_OK && length $input);
+    }
+    
+    die "inflation failed\n"
+        unless $status == Z_STREAM_END ;
 
+Points to note this time:
+
+=over 5
+
+=item *
+
+There are now two nested loops in the code: the outer loop for reading the
+compressed data from STDIN, as before; and the inner loop to carry out the
+uncompression.
+
+=item *
+
+There are two exit points from the inner uncompression loop.
+
+Firstly when C<inflate> has returned a status other than C<Z_OK> or
+C<Z_BUF_ERROR>.  This means that either the end of the compressed data
+stream has been reached (C<Z_STREAM_END>) or there is an error in the
+compressed data. In either of these cases there is no point in continuing
+with reading the compressed data, so both loops are terminated.
+
+The second exit point tests if there is any data left in the input buffer,
+C<$input> - remember that the C<ConsumeInput> option is automatically
+enabled when C<LimitOutput> is used.  When the input buffer has been
+exhausted, the outer loop can run again and overwrite a now empty
+C<$input>.
+
+=back
+
+=head1 ACCESSING ZIP FILES
+
+Although it is possible (with some effort on your part) to use this module
+to access .zip files, there are other perl modules available that will
+do all the hard work for you. Check out C<Archive::Zip>,
+C<IO::Compress::Zip> and C<IO::Uncompress::Unzip>.
 
 =head1 CONSTANTS
 
 All the I<zlib> constants are automatically imported when you make use
 of I<Compress::Raw::Zlib>.
 
-
 =head1 SEE ALSO
 
-L<Compress::Zlib>, L<IO::Compress::Gzip>, L<IO::Uncompress::Gunzip>, L<IO::Compress::Deflate>, L<IO::Uncompress::Inflate>, L<IO::Compress::RawDeflate>, L<IO::Uncompress::RawInflate>, L<IO::Compress::Bzip2>, L<IO::Uncompress::Bunzip2>, L<IO::Compress::Lzop>, L<IO::Uncompress::UnLzop>, L<IO::Compress::Lzf>, L<IO::Uncompress::UnLzf>, L<IO::Uncompress::AnyInflate>, L<IO::Uncompress::AnyUncompress>
+L<Compress::Zlib>, L<IO::Compress::Gzip>, L<IO::Uncompress::Gunzip>, L<IO::Compress::Deflate>, L<IO::Uncompress::Inflate>, L<IO::Compress::RawDeflate>, L<IO::Uncompress::RawInflate>, L<IO::Compress::Bzip2>, L<IO::Uncompress::Bunzip2>, L<IO::Compress::Lzma>, L<IO::Uncompress::UnLzma>, L<IO::Compress::Xz>, L<IO::Uncompress::UnXz>, L<IO::Compress::Lzop>, L<IO::Uncompress::UnLzop>, L<IO::Compress::Lzf>, L<IO::Uncompress::UnLzf>, L<IO::Uncompress::AnyInflate>, L<IO::Uncompress::AnyUncompress>
 
 L<Compress::Zlib::FAQ|Compress::Zlib::FAQ>
 
@@ -1160,7 +1389,6 @@
 L<Archive::Tar|Archive::Tar>,
 L<IO::Zlib|IO::Zlib>
 
-
 For RFC 1950, 1951 and 1952 see 
 F<http://www.faqs.org/rfcs/rfc1950.html>,
 F<http://www.faqs.org/rfcs/rfc1951.html> and
@@ -1174,25 +1402,18 @@
 
 The primary site for gzip is F<http://www.gzip.org>.
 
-
-
-
 =head1 AUTHOR
 
 This module was written by Paul Marquess, F<pmqs at cpan.org>. 
 
-
-
 =head1 MODIFICATION HISTORY
 
 See the Changes file.
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright (c) 2005-2007 Paul Marquess. All rights reserved.
+Copyright (c) 2005-2009 Paul Marquess. All rights reserved.
 
 This program is free software; you can redistribute it and/or
 modify it under the same terms as Perl itself.
 
-
-
diff -urN perl-5.10.0.orig/ext/Compress/Raw/Zlib/t/02zlib.t perl-5.10.0/ext/Compress/Raw/Zlib/t/02zlib.t
--- perl-5.10.0.orig/ext/Compress/Raw/Zlib/t/02zlib.t	2009-12-01 15:36:07.000000000 +0100
+++ perl-5.10.0/ext/Compress/Raw/Zlib/t/02zlib.t	2009-12-01 15:38:24.000000000 +0100
@@ -24,13 +24,13 @@
 
     my $count = 0 ;
     if ($] < 5.005) {
-        $count = 189 ;
+        $count = 230 ;
     }
     elsif ($] >= 5.006) {
-        $count = 243 ;
+        $count = 300 ;
     }
     else {
-        $count = 201 ;
+        $count = 258 ;
     }
 
     plan tests => $count + $extra;
@@ -443,10 +443,13 @@
     
     # create a flush point
     cmp_ok $x->flush($Answer, Z_FULL_FLUSH), '==', Z_OK ;
+    
+    my $len1 = length $Answer;
      
     cmp_ok $x->deflate($goodbye, $Answer), '==', Z_OK;
     
     cmp_ok $x->flush($Answer), '==', Z_OK ;
+    my $len2 = length($Answer) - $len1 ;
      
     my ($first, @Answer) = split('', $Answer) ;
      
@@ -475,7 +478,6 @@
         $GOT .= $Z if defined $Z ;
         # print "x $status\n";
         last if $status == Z_STREAM_END or $status != Z_OK ;
-     
     }
      
     cmp_ok $status, '==', Z_DATA_ERROR ;
@@ -488,7 +490,7 @@
     my $initial = $1 ;
 
     
-    ok(($k, $err) = new Compress::Raw::Zlib::Inflate(-ConsumeInput => 0)) ;
+    ok(($k, $err) = new Compress::Raw::Zlib::Inflate(ConsumeInput => 0)) ;
     ok $k ;
     cmp_ok $err, '==', Z_OK ;
      
@@ -499,8 +501,11 @@
     cmp_ok $status, '==', Z_OK
      or diag "status '$status'\nlength rest is " . length($rest) . "\n" ;
      
-    cmp_ok $k->inflate($rest, $GOT), '==', Z_DATA_ERROR;
-    is $Z . $GOT, $goodbye ;
+    is length($rest), $len2, "expected compressed output";
+    
+    $GOT = ''; 
+    cmp_ok $k->inflate($rest, $GOT), '==', Z_DATA_ERROR, "inflate returns Z_DATA_ERROR";
+    is $GOT, $goodbye ;
 }
 
 {
@@ -598,7 +603,7 @@
 
 foreach (1 .. 2)
 {
-    next if $[ < 5.005 ;
+    next if $] < 5.005 ;
 
     title 'test inflate/deflate with a substr';
 
@@ -726,6 +731,142 @@
     ok 1, "resetLastBlockByte(undef) is ok" ;
 }
 
+{
+
+    title "gzip mode";
+    # ================
+
+    my $hello = "I am a HAL 9000 computer" ;
+    my @hello = split('', $hello) ;
+    my ($err, $x, $X, $status); 
+ 
+    ok( ($x, $err) = new Compress::Raw::Zlib::Deflate ( 
+            WindowBits => WANT_GZIP ,
+            AppendOutput => 1
+        ), "Create deflate object" );
+    ok $x, "Compress::Raw::Zlib::Deflate ok" ;
+    cmp_ok $err, '==', Z_OK, "status is Z_OK" ;
+ 
+    $status = $x->deflate($hello, $X) ;
+    cmp_ok $status, '==', Z_OK, "deflate returned Z_OK" ;
+    
+    cmp_ok  $x->flush($X), '==', Z_OK, "flush returned Z_OK" ;
+     
+    my ($k, $GOT); 
+    ($k, $err) = new Compress::Raw::Zlib::Inflate( 
+            WindowBits => WANT_GZIP ,
+            ConsumeInput => 0 ,
+            AppendOutput => 1);
+    ok $k, "Compress::Raw::Zlib::Inflate WANT_GZIP ok" ;
+    cmp_ok $err, '==', Z_OK, "status is Z_OK" ;
+ 
+    $status = $k->inflate($X, $GOT) ;
+    cmp_ok $status, '==', Z_STREAM_END, "Got Z_STREAM_END" ;
+    is $GOT, $hello, "uncompressed data matches ok" ;
+
+    $GOT = '';
+    ($k, $err) = new Compress::Raw::Zlib::Inflate( 
+            WindowBits => WANT_GZIP_OR_ZLIB ,
+            AppendOutput => 1);
+    ok $k, "Compress::Raw::Zlib::Inflate WANT_GZIP_OR_ZLIB ok" ;
+    cmp_ok $err, '==', Z_OK, "status is Z_OK" ;
+ 
+    $status = $k->inflate($X, $GOT) ;
+    cmp_ok $status, '==', Z_STREAM_END, "Got Z_STREAM_END" ;
+    is $GOT, $hello, "uncompressed data matches ok" ;
+}
+
+{
+
+    title "gzip error mode";
+    # Create gzip -
+    # read with no special windowbits setting - this will fail
+    # then read with WANT_GZIP_OR_ZLIB - thi swill work
+    # ================
+
+    my $hello = "I am a HAL 9000 computer" ;
+    my ($err, $x, $X, $status); 
+ 
+    ok( ($x, $err) = new Compress::Raw::Zlib::Deflate ( 
+            WindowBits => WANT_GZIP ,
+            AppendOutput => 1
+        ), "Create deflate object" );
+    ok $x, "Compress::Raw::Zlib::Deflate ok" ;
+    cmp_ok $err, '==', Z_OK, "status is Z_OK" ;
+ 
+    $status = $x->deflate($hello, $X) ;
+    cmp_ok $status, '==', Z_OK, "deflate returned Z_OK" ;
+    
+    cmp_ok  $x->flush($X), '==', Z_OK, "flush returned Z_OK" ;
+     
+    my ($k, $GOT); 
+    ($k, $err) = new Compress::Raw::Zlib::Inflate( 
+            WindowBits => MAX_WBITS ,
+            ConsumeInput => 0 ,
+            AppendOutput => 1);
+    ok $k, "Compress::Raw::Zlib::Inflate WANT_GZIP ok" ;
+    cmp_ok $err, '==', Z_OK, "status is Z_OK" ;
+ 
+    $status = $k->inflate($X, $GOT) ;
+    cmp_ok $status, '==', Z_DATA_ERROR, "Got Z_DATA_ERROR" ;
+
+    $GOT = '';
+    ($k, $err) = new Compress::Raw::Zlib::Inflate( 
+            WindowBits => WANT_GZIP_OR_ZLIB ,
+            AppendOutput => 1);
+    ok $k, "Compress::Raw::Zlib::Inflate WANT_GZIP_OR_ZLIB ok" ;
+    cmp_ok $err, '==', Z_OK, "status is Z_OK" ;
+ 
+    $status = $k->inflate($X, $GOT) ;
+    cmp_ok $status, '==', Z_STREAM_END, "Got Z_STREAM_END" ;
+    is $GOT, $hello, "uncompressed data matches ok" ;
+}
+
+{
+
+    title "gzip/zlib error mode";
+    # Create zlib -
+    # read with no WANT_GZIP windowbits setting - this will fail
+    # then read with WANT_GZIP_OR_ZLIB - thi swill work
+    # ================
+
+    my $hello = "I am a HAL 9000 computer" ;
+    my ($err, $x, $X, $status); 
+ 
+    ok( ($x, $err) = new Compress::Raw::Zlib::Deflate ( 
+            AppendOutput => 1
+        ), "Create deflate object" );
+    ok $x, "Compress::Raw::Zlib::Deflate ok" ;
+    cmp_ok $err, '==', Z_OK, "status is Z_OK" ;
+ 
+    $status = $x->deflate($hello, $X) ;
+    cmp_ok $status, '==', Z_OK, "deflate returned Z_OK" ;
+    
+    cmp_ok  $x->flush($X), '==', Z_OK, "flush returned Z_OK" ;
+     
+    my ($k, $GOT); 
+    ($k, $err) = new Compress::Raw::Zlib::Inflate( 
+            WindowBits => WANT_GZIP ,
+            ConsumeInput => 0 ,
+            AppendOutput => 1);
+    ok $k, "Compress::Raw::Zlib::Inflate WANT_GZIP ok" ;
+    cmp_ok $err, '==', Z_OK, "status is Z_OK" ;
+ 
+    $status = $k->inflate($X, $GOT) ;
+    cmp_ok $status, '==', Z_DATA_ERROR, "Got Z_DATA_ERROR" ;
+
+    $GOT = '';
+    ($k, $err) = new Compress::Raw::Zlib::Inflate( 
+            WindowBits => WANT_GZIP_OR_ZLIB ,
+            AppendOutput => 1);
+    ok $k, "Compress::Raw::Zlib::Inflate WANT_GZIP_OR_ZLIB ok" ;
+    cmp_ok $err, '==', Z_OK, "status is Z_OK" ;
+ 
+    $status = $k->inflate($X, $GOT) ;
+    cmp_ok $status, '==', Z_STREAM_END, "Got Z_STREAM_END" ;
+    is $GOT, $hello, "uncompressed data matches ok" ;
+}
+
 exit if $] < 5.006 ;
 
 title 'Looping Append test with substr output - substr the end of the string';
diff -urN perl-5.10.0.orig/ext/Compress/Raw/Zlib/t/09limitoutput.t perl-5.10.0/ext/Compress/Raw/Zlib/t/09limitoutput.t
--- perl-5.10.0.orig/ext/Compress/Raw/Zlib/t/09limitoutput.t	1970-01-01 01:00:00.000000000 +0100
+++ perl-5.10.0/ext/Compress/Raw/Zlib/t/09limitoutput.t	2009-03-25 12:14:56.000000000 +0100
@@ -0,0 +1,129 @@
+BEGIN {
+    if ($ENV{PERL_CORE}) {
+	chdir 't' if -d 't';
+	@INC = ("../lib", "lib/compress");
+    }
+}
+
+use lib qw(t t/compress);
+use strict;
+use warnings;
+use bytes;
+
+use Test::More ;
+use CompTestUtils;
+
+BEGIN 
+{ 
+    # use Test::NoWarnings, if available
+    my $extra = 0 ;
+    $extra = 1
+        if eval { require Test::NoWarnings ;  import Test::NoWarnings; 1 };
+
+    plan tests => 98 + $extra ;
+
+    use_ok('Compress::Raw::Zlib', 2) ; 
+}
+
+
+
+my $hello = "I am a HAL 9000 computer" x 2001;
+my $tmp = $hello ;
+
+my ($err, $x, $X, $status); 
+
+ok( ($x, $err) = new Compress::Raw::Zlib::Deflate (-AppendOutput => 1));
+ok $x ;
+cmp_ok $err, '==', Z_OK, "  status is Z_OK" ;
+
+my $out ;
+$status = $x->deflate($tmp, $out) ;
+cmp_ok $status, '==', Z_OK, "  status is Z_OK" ;
+
+cmp_ok $x->flush($out), '==', Z_OK, "  flush returned Z_OK" ;
+     
+     
+sub getOut { my $x = ''; return \$x }
+
+for my $bufsize (1, 2, 3, 13, 4096, 1024*10)
+{
+    print "#\n#Bufsize $bufsize\n#\n";
+    $tmp = $out;
+
+    my $k;
+    ok(($k, $err) = new Compress::Raw::Zlib::Inflate( AppendOutput => 1,
+                                                      LimitOutput => 1,
+                                                      Bufsize => $bufsize
+                                                    ));
+    ok $k ;
+    cmp_ok $err, '==', Z_OK, "  status is Z_OK" ;
+ 
+    ok ! defined $k->msg(), "  no msg" ;
+    is $k->total_in(), 0, "  total_in == 0" ;
+    is $k->total_out(), 0, "  total_out == 0" ;
+    my $GOT = getOut();
+    my $prev;
+    my $deltaOK = 1;
+    my $looped = 0;
+    while (length $tmp)
+    {
+        ++ $looped;
+        my $prev = length $GOT;
+        $status = $k->inflate($tmp, $GOT) ;
+        last if $status == Z_STREAM_END || $status == Z_DATA_ERROR || $status == Z_STREAM_ERROR ;
+        $deltaOK = 0 if length($GOT) - $prev > $bufsize;
+    }
+     
+    ok $deltaOK, "  Output Delta never > $bufsize";
+    cmp_ok $looped, '>=', 1, "  looped $looped";
+    is length($tmp), 0, "  length of input buffer is zero";
+
+    cmp_ok $status, '==', Z_STREAM_END, "  status is Z_STREAM_END" ;
+    is $$GOT, $hello, "  got expected output" ;
+    ok ! defined $k->msg(), "  no msg" ;
+    is $k->total_in(), length $out, "  length total_in ok" ;
+    is $k->total_out(), length $hello, "  length total_out ok " .  $k->total_out() ;
+}
+
+sub getit
+{
+    my $obj = shift ;
+    my $input = shift;
+    
+    my $data ;
+    1 while $obj->inflate($input, $data) != Z_STREAM_END ;
+    return \$data ;
+}
+
+{
+    title "regression test";
+    
+    my ($err, $x, $X, $status); 
+    
+    ok( ($x, $err) = new Compress::Raw::Zlib::Deflate (-AppendOutput => 1));
+    ok $x ;
+    cmp_ok $err, '==', Z_OK, "  status is Z_OK" ;
+
+    my $line1 = ("abcdefghijklmnopq" x 1000) . "\n" ;
+    my $line2 = "second line\n" ;
+    my $text = $line1 . $line2 ;
+    my $tmp = $text;
+   
+    my $out ;
+    $status = $x->deflate($tmp, $out) ;
+    cmp_ok $status, '==', Z_OK, "  status is Z_OK" ;
+    
+    cmp_ok $x->flush($out), '==', Z_OK, "  flush returned Z_OK" ;
+
+    my $k;
+    ok(($k, $err) = new Compress::Raw::Zlib::Inflate( AppendOutput => 1,
+                                                      LimitOutput => 1
+                                                    ));
+
+                                                        
+    my $c = getit($k, $out);
+    is $$c, $text;
+    
+                                              
+}
+

perl-update-IO-Compress-Zlib.patch:
 MANIFEST                                                   |    1 
 ext/IO_Compress_Zlib/Changes                               |   38 +
 ext/IO_Compress_Zlib/Makefile.PL                           |    9 
 ext/IO_Compress_Zlib/README                                |   44 --
 ext/IO_Compress_Zlib/lib/IO/Compress/Adapter/Deflate.pm    |    6 
 ext/IO_Compress_Zlib/lib/IO/Compress/Adapter/Identity.pm   |    4 
 ext/IO_Compress_Zlib/lib/IO/Compress/Deflate.pm            |  143 ------
 ext/IO_Compress_Zlib/lib/IO/Compress/Gzip.pm               |  148 ------
 ext/IO_Compress_Zlib/lib/IO/Compress/Gzip/Constants.pm     |    2 
 ext/IO_Compress_Zlib/lib/IO/Compress/RawDeflate.pm         |  146 ------
 ext/IO_Compress_Zlib/lib/IO/Compress/Zip.pm                |  226 +++-------
 ext/IO_Compress_Zlib/lib/IO/Compress/Zip/Constants.pm      |   18 
 ext/IO_Compress_Zlib/lib/IO/Compress/Zlib/Constants.pm     |    2 
 ext/IO_Compress_Zlib/lib/IO/Compress/Zlib/Extra.pm         |    4 
 ext/IO_Compress_Zlib/lib/IO/Uncompress/Adapter/Identity.pm |    6 
 ext/IO_Compress_Zlib/lib/IO/Uncompress/Adapter/Inflate.pm  |    6 
 ext/IO_Compress_Zlib/lib/IO/Uncompress/AnyInflate.pm       |  143 ------
 ext/IO_Compress_Zlib/lib/IO/Uncompress/Gunzip.pm           |  141 ------
 ext/IO_Compress_Zlib/lib/IO/Uncompress/Inflate.pm          |  131 ------
 ext/IO_Compress_Zlib/lib/IO/Uncompress/RawInflate.pm       |  126 -----
 ext/IO_Compress_Zlib/lib/IO/Uncompress/Unzip.pm            |  204 +++------
 ext/IO_Compress_Zlib/t/006zip.t                            |  276 +++++++++++++
 22 files changed, 614 insertions(+), 1210 deletions(-)

--- NEW FILE perl-update-IO-Compress-Zlib.patch ---
IO-Compress-Zlib-2.015
(omitting changes to private/MakeUtil.pm)
(omitting changes to perl-5.10.0/t/lib/compress; these are in
IO-Compress-Base 2.015 update)

diff -urN perl-5.10.0.orig/MANIFEST perl-5.10.0/MANIFEST
--- perl-5.10.0.orig/MANIFEST	2009-12-01 11:02:59.000000000 +0100
+++ perl-5.10.0/MANIFEST	2009-12-01 12:10:21.000000000 +0100
@@ -736,6 +736,7 @@
 ext/IO_Compress_Zlib/t/002any-zip.t	IO::Compress::Zlib
 ext/IO_Compress_Zlib/t/004gziphdr.t	IO::Compress::Zlib
 ext/IO_Compress_Zlib/t/005defhdr.t	IO::Compress::Zlib
+ext/IO_Compress_Zlib/t/006zip.t	IO::Compress::Zlib
 ext/IO_Compress_Zlib/t/010examples.t	IO::Compress::Zlib
 ext/IO_Compress_Zlib/t/020isize.t	IO::Compress::Zlib
 ext/IO_Compress_Zlib/t/050interop-gzip.t	IO::Compress::Zlib
diff -urN perl-5.10.0.orig/ext/IO_Compress_Zlib/Changes perl-5.10.0/ext/IO_Compress_Zlib/Changes
--- perl-5.10.0.orig/ext/IO_Compress_Zlib/Changes	2007-12-18 11:47:07.000000000 +0100
+++ perl-5.10.0/ext/IO_Compress_Zlib/Changes	2009-12-01 12:05:25.000000000 +0100
@@ -1,6 +1,44 @@
 CHANGES
 -------
 
+  2.015 3 September 2008
+
+      * Makefile.PL
+        Backout changes made in 2.014
+
+  2.014 2 September 2008
+
+      * Makefile.PL
+        Updated to check for indirect dependencies.
+
+  2.012 15 July 2008
+
+      * No Changes
+
+  2.011 17 May 2008
+
+      * IO::Uncompress::Unzip 
+        - Print an error message if the zip file contains a
+          member compressed with bzip2 and IO::Uncompress::Bunzip2 is 
+          not available.
+        - Could not cope with mixed compression zip files. For example a
+          zip file that contains both STORED and DEFLATED content.
+          [RT #35573]
+
+  2.010 5 May 2008
+
+      * Fixed problem that meant Perl 5.10 could not upgrade this module.
+        [RT #35343]
+
+  2.009 20 April 2008
+
+      * IO::Compress::Zip 
+
+        - Added exUnix2 option to allow storing of UID & GID.
+        - When running on a Unix derivative the ExtAttr option now defaults
+          to the equivalent of 0666. For all other systems the default
+          remains 0.
+
   2.008 2 November 2007
 
       * Minor documentation changes in README
diff -urN perl-5.10.0.orig/ext/IO_Compress_Zlib/Makefile.PL perl-5.10.0/ext/IO_Compress_Zlib/Makefile.PL
--- perl-5.10.0.orig/ext/IO_Compress_Zlib/Makefile.PL	2007-12-18 11:47:07.000000000 +0100
+++ perl-5.10.0/ext/IO_Compress_Zlib/Makefile.PL	2009-12-01 12:05:35.000000000 +0100
@@ -3,7 +3,7 @@
 use strict ;
 require 5.004 ;
 
-$::VERSION = '2.008' ;
+$::VERSION = '2.015' ;
 
 use private::MakeUtil;
 use ExtUtils::MakeMaker 5.16 ;
@@ -51,6 +51,13 @@
 
     INSTALLDIRS => ($] >= 5.009 ? 'perl' : 'site'),
 
+    (
+    $] >= 5.009 && ! $ENV{PERL_CORE}
+        ? (INST_LIB    => 'blib/arch')
+        : ()
+    ),
+
+
     ((ExtUtils::MakeMaker->VERSION() gt '6.30') ?
         ('LICENSE'  => 'perl')         : ()),    
 
diff -urN perl-5.10.0.orig/ext/IO_Compress_Zlib/README perl-5.10.0/ext/IO_Compress_Zlib/README
--- perl-5.10.0.orig/ext/IO_Compress_Zlib/README	2007-12-18 11:47:07.000000000 +0100
+++ perl-5.10.0/ext/IO_Compress_Zlib/README	2009-12-01 12:05:41.000000000 +0100
@@ -1,44 +1,30 @@
 
                              IO-Compress-Zlib
 
-                             Version 2.008
+                             Version 2.015
 
-                             2nd November 2007
+                            2nd September 2008
 
-
-       Copyright (c) 2005-2007 Paul Marquess. All rights reserved.
+       Copyright (c) 2005-2008 Paul Marquess. All rights reserved.
           This program is free software; you can redistribute it
            and/or modify it under the same terms as Perl itself.
 
-
-
-
 DESCRIPTION
 -----------
 
-
 This module provides a Perl interface to allow reading and writing of RFC
 1950, 1951, 1952 (i.e. gzip) and zip files/buffers.
 
-
-
-
-
 PREREQUISITES
 -------------
 
 Before you can build IO-Compress-Zlib you need to have the following
 installed on your system:
 
-
     * Perl 5.004 or better. 
     * Compress::Raw::Zlib
     * IO::Compress::Base
 
-
-
-
-
 BUILDING THE MODULE
 -------------------
 
@@ -49,8 +35,6 @@
     make
     make test
 
-
-
 INSTALLATION
 ------------
 
@@ -58,28 +42,16 @@
 
     make install
 
-
-
-
-
 TROUBLESHOOTING
 ---------------
 
-
-
-
-
-
-
-
-
 The t/020isize Test Suite
 ------------------------
 
 This test suite checks that IO-Compress-Zlib can cope with gzip files
 that are larger than 2^32 bytes.
 
-By default these test are NOT run when you do a "make test". If you
+By default these tests are NOT run when you do a "make test". If you
 really want to run them, you need to execute "make longtest".
 
 Be warned though -- this test suite can take hours to run on a slow box.
@@ -88,9 +60,6 @@
 run out of memory during this test. This should not be considered a bug
 in the IO-Compress-Zlib module.
 
-
-
-
 FEEDBACK
 --------
 
@@ -124,9 +93,7 @@
         If you haven't installed IO-Compress-Zlib then search IO::Compress::Gzip.pm
         for a line like this:
 
-          $VERSION = "2.008" ;
-
-
+          $VERSION = "2.015" ;
 
[...4833 lines suppressed...]
+                   'goodbye ',
+                   );
+
+    my $zip = new IO::Compress::Zip $file1,
+                    Name => "one", Method => ZIP_CM_DEFLATE, Stream => 0;
+    isa_ok $zip, "IO::Compress::Zip";
+
+    is $zip->write($content[0]), length($content[0]), "write"; 
+    $zip->newStream(Name=> "two", Method => ZIP_CM_DEFLATE);
+    is $zip->write($content[1]), length($content[1]), "write"; 
+    $zip->newStream(Name=> "three", Method => ZIP_CM_DEFLATE);
+    is $zip->write($content[2]), length($content[2]), "write"; 
+    ok $zip->close(), "closed";                    
+
+    my @got = getContent($file1);
+
+    is $got[0], $content[0], "Got 1st entry";
+    is $got[1], $content[1], "Got 2nd entry";
+    is $got[2], $content[2], "Got 3nd entry";
+}
+
+SKIP:
+{
+    title "Create a simple zip - All Bzip2";
+
+    skip "IO::Compress::Bzip2 not available", 9
+        unless defined $IO::Compress::Bzip2::VERSION;
+
+    my $lex = new LexFile my $file1;
+
+    my @content = (
+                   'hello',
+                   '',
+                   'goodbye ',
+                   );
+
+    my $zip = new IO::Compress::Zip $file1,
+                    Name => "one", Method => ZIP_CM_BZIP2, Stream => 0;
+    isa_ok $zip, "IO::Compress::Zip";
+
+    is $zip->write($content[0]), length($content[0]), "write"; 
+    $zip->newStream(Name=> "two", Method => ZIP_CM_BZIP2);
+    is $zip->write($content[1]), length($content[1]), "write"; 
+    $zip->newStream(Name=> "three", Method => ZIP_CM_BZIP2);
+    is $zip->write($content[2]), length($content[2]), "write"; 
+    ok $zip->close(), "closed";                    
+
+    my @got = getContent($file1);
+
+    is $got[0], $content[0], "Got 1st entry";
+    is $got[1], $content[1], "Got 2nd entry";
+    is $got[2], $content[2], "Got 3nd entry";
+}
+
+SKIP:
+{
+    title "Create a simple zip - Deflate + Bzip2";
+
+    skip "IO::Compress::Bzip2 not available", 9
+        unless $IO::Compress::Bzip2::VERSION;
+
+    my $lex = new LexFile my $file1;
+
+    my @content = (
+                   'hello',
+                   'and',
+                   'goodbye ',
+                   );
+
+    my $zip = new IO::Compress::Zip $file1,
+                    Name => "one", Method => ZIP_CM_DEFLATE, Stream => 0;
+    isa_ok $zip, "IO::Compress::Zip";
+
+    is $zip->write($content[0]), length($content[0]), "write"; 
+    $zip->newStream(Name=> "two", Method => ZIP_CM_BZIP2);
+    is $zip->write($content[1]), length($content[1]), "write"; 
+    $zip->newStream(Name=> "three", Method => ZIP_CM_DEFLATE);
+    is $zip->write($content[2]), length($content[2]), "write"; 
+    ok $zip->close(), "closed";                    
+
+    my @got = getContent($file1);
+
+    is $got[0], $content[0], "Got 1st entry";
+    is $got[1], $content[1], "Got 2nd entry";
+    is $got[2], $content[2], "Got 3nd entry";
+}
+
+{
+    title "Create a simple zip - All STORE";
+
+    my $lex = new LexFile my $file1;
+
+    my @content = (
+                   'hello',
+                   '',
+                   'goodbye ',
+                   );
+
+    my $zip = new IO::Compress::Zip $file1,
+                    Name => "one", Method => ZIP_CM_STORE, Stream => 0;
+    isa_ok $zip, "IO::Compress::Zip";
+
+    is $zip->write($content[0]), length($content[0]), "write"; 
+    $zip->newStream(Name=> "two", Method => ZIP_CM_STORE);
+    is $zip->write($content[1]), length($content[1]), "write"; 
+    $zip->newStream(Name=> "three", Method => ZIP_CM_STORE);
+    is $zip->write($content[2]), length($content[2]), "write"; 
+    ok $zip->close(), "closed";                    
+
+    my @got = getContent($file1);
+
+    is $got[0], $content[0], "Got 1st entry";
+    is $got[1], $content[1], "Got 2nd entry";
+    is $got[2], $content[2], "Got 3nd entry";
+}
+
+{
+    title "Create a simple zip - Deflate + STORE";
+
+    my $lex = new LexFile my $file1;
+
+    my @content = qw(
+                   hello 
+                       and
+                   goodbye 
+                   );
+
+    my $zip = new IO::Compress::Zip $file1,
+                    Name => "one", Method => ZIP_CM_DEFLATE, Stream => 0;
+    isa_ok $zip, "IO::Compress::Zip";
+
+    is $zip->write($content[0]), length($content[0]), "write"; 
+    $zip->newStream(Name=> "two", Method => ZIP_CM_STORE);
+    is $zip->write($content[1]), length($content[1]), "write"; 
+    $zip->newStream(Name=> "three", Method => ZIP_CM_DEFLATE);
+    is $zip->write($content[2]), length($content[2]), "write"; 
+    ok $zip->close(), "closed";                    
+
+    my @got = getContent($file1);
+
+    is $got[0], $content[0], "Got 1st entry";
+    is $got[1], $content[1], "Got 2nd entry";
+    is $got[2], $content[2], "Got 3nd entry";
+}
+
+{
+    title "Create a simple zip - Deflate + zero length STORE";
+
+    my $lex = new LexFile my $file1;
+
+    my @content = (
+                   'hello ',
+                   '',
+                   'goodbye ',
+                   );
+
+    my $zip = new IO::Compress::Zip $file1,
+                    Name => "one", Method => ZIP_CM_DEFLATE, Stream => 0;
+    isa_ok $zip, "IO::Compress::Zip";
+
+    is $zip->write($content[0]), length($content[0]), "write"; 
+    $zip->newStream(Name=> "two", Method => ZIP_CM_STORE);
+    is $zip->write($content[1]), length($content[1]), "write"; 
+    $zip->newStream(Name=> "three", Method => ZIP_CM_DEFLATE);
+    is $zip->write($content[2]), length($content[2]), "write"; 
+    ok $zip->close(), "closed";                    
+
+    my @got = getContent($file1);
+
+    is $got[0], $content[0], "Got 1st entry";
+    ok $got[1] eq $content[1], "Got 2nd entry";
+    is $got[2], $content[2], "Got 3nd entry";
+}
+
+
+SKIP:
+for my $method (ZIP_CM_DEFLATE, ZIP_CM_STORE, ZIP_CM_BZIP2)
+{
+    title "Read a line from zip, Method $method";
+
+    skip "IO::Compress::Bzip2 not available", 14
+        unless defined $IO::Compress::Bzip2::VERSION;
+
+    my $content = "a single line\n";
+    my $zip ;
+
+    my $status = zip \$content => \$zip, 
+                    Method => $method, 
+                    Stream => 0, 
+                    Name => "123";
+    is $status, 1, "  Created a zip file";
+
+    my $u = new IO::Uncompress::Unzip \$zip;
+    isa_ok $u, "IO::Uncompress::Unzip";
+
+    is $u->getline, $content, "  Read first line ok";
+    ok ! $u->getline, "  Second line doesn't exist";
+
+
+}

perl-update-IO-Compress-Base.patch:
 ext/IO_Compress_Base/Changes                            |   68 +++++++
 ext/IO_Compress_Base/Makefile.PL                        |    6 
 ext/IO_Compress_Base/README                             |   42 ----
 ext/IO_Compress_Base/lib/File/GlobMapper.pm             |   20 --
 ext/IO_Compress_Base/lib/IO/Compress/Base.pm            |   47 +---
 ext/IO_Compress_Base/lib/IO/Compress/Base/Common.pm     |   51 ++++-
 ext/IO_Compress_Base/lib/IO/Uncompress/AnyUncompress.pm |  152 ++--------------
 ext/IO_Compress_Base/lib/IO/Uncompress/Base.pm          |   85 ++++++--
 ext/IO_Compress_Base/t/01misc.t                         |   38 +++-
 t/lib/compress/CompTestUtils.pm                         |   20 ++
 t/lib/compress/destroy.pl                               |   39 ++++
 t/lib/compress/generic.pl                               |   19 --
 12 files changed, 318 insertions(+), 269 deletions(-)

View full diff with command:
/usr/bin/cvs -n -f diff -kk -u -p -N -r 1.1 -r 1.2 perl-update-IO-Compress-Base.patchIndex: perl-update-IO-Compress-Base.patch
===================================================================
RCS file: /cvs/extras/rpms/perl/F-12/perl-update-IO-Compress-Base.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- perl-update-IO-Compress-Base.patch	30 Nov 2009 14:01:23 -0000	1.1
+++ perl-update-IO-Compress-Base.patch	1 Dec 2009 15:15:30 -0000	1.2
@@ -1,6 +1,9 @@
-diff -up perl-5.10.0/ext/IO_Compress_Base/Changes.xxx perl-5.10.0/ext/IO_Compress_Base/Changes
---- perl-5.10.0/ext/IO_Compress_Base/Changes.xxx	2007-12-18 11:47:07.000000000 +0100
-+++ perl-5.10.0/ext/IO_Compress_Base/Changes	2008-09-03 15:12:46.000000000 +0200
+IO-Compress-Base-2.015
+(omitting changes to private/MakeUtil.pm)
+
+diff -urN perl-5.10.0.orig/ext/IO_Compress_Base/Changes perl-5.10.0/ext/IO_Compress_Base/Changes
+--- perl-5.10.0.orig/ext/IO_Compress_Base/Changes	2007-12-18 11:47:07.000000000 +0100
++++ perl-5.10.0/ext/IO_Compress_Base/Changes	2009-12-01 11:17:37.000000000 +0100
 @@ -1,6 +1,74 @@
  CHANGES
  -------
@@ -76,10 +79,126 @@ diff -up perl-5.10.0/ext/IO_Compress_Bas
    2.008 2 November 2007
  
        * Minor documentation changes in README
-diff -up perl-5.10.0/ext/IO_Compress_Base/lib/File/GlobMapper.pm.xxx perl-5.10.0/ext/IO_Compress_Base/lib/File/GlobMapper.pm
---- perl-5.10.0/ext/IO_Compress_Base/lib/File/GlobMapper.pm.xxx	2007-12-18 11:47:07.000000000 +0100
-+++ perl-5.10.0/ext/IO_Compress_Base/lib/File/GlobMapper.pm	2008-02-18 23:23:15.000000000 +0100
-@@ -26,7 +26,7 @@ BEGIN
+diff -urN perl-5.10.0.orig/ext/IO_Compress_Base/Makefile.PL perl-5.10.0/ext/IO_Compress_Base/Makefile.PL
+--- perl-5.10.0.orig/ext/IO_Compress_Base/Makefile.PL	2007-12-18 11:47:07.000000000 +0100
++++ perl-5.10.0/ext/IO_Compress_Base/Makefile.PL	2009-12-01 11:17:37.000000000 +0100
+@@ -37,6 +37,12 @@
+ 
+     INSTALLDIRS => ($] >= 5.009 ? 'perl' : 'site'),
+ 
++    (
++    $] >= 5.009 && ! $ENV{PERL_CORE}
++        ? (INST_LIB    => 'blib/arch')
++        : ()
++    ),
++
+     ((ExtUtils::MakeMaker->VERSION() gt '6.30') ?
+         ('LICENSE'  => 'perl')         : ()),
+     
+diff -urN perl-5.10.0.orig/ext/IO_Compress_Base/README perl-5.10.0/ext/IO_Compress_Base/README
+--- perl-5.10.0.orig/ext/IO_Compress_Base/README	2007-12-18 11:47:07.000000000 +0100
++++ perl-5.10.0/ext/IO_Compress_Base/README	2009-12-01 11:17:37.000000000 +0100
+@@ -1,42 +1,28 @@
+ 
+                              IO-Compress-Base
+ 
+-                             Version 2.008
++                             Version 2.015
+ 
+-                             2nd November 2007
++                            2nd September 2008
+ 
+-
+-       Copyright (c) 2005-2007 Paul Marquess. All rights reserved.
++       Copyright (c) 2005-2008 Paul Marquess. All rights reserved.
+           This program is free software; you can redistribute it
+            and/or modify it under the same terms as Perl itself.
+ 
+-
+-
+-
+ DESCRIPTION
+ -----------
+ 
+-
+ This module is the base class for all IO::Compress and IO::Uncompress
+ modules.
+ 
+-
+-
+-
+-
+ PREREQUISITES
+ -------------
+ 
+ Before you can build IO-Compress-Base you need to have the following
+ installed on your system:
+ 
+-
+     * Perl 5.004 or better. 
+ 
+-
+-
+-
+-
+ BUILDING THE MODULE
+ -------------------
+ 
+@@ -47,8 +33,6 @@
+     make
+     make test
+ 
+-
+-
+ INSTALLATION
+ ------------
+ 
+@@ -56,24 +40,9 @@
+ 
+     make install
+ 
+-
+-
+-
+-
+ TROUBLESHOOTING
+ ---------------
+ 
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+ FEEDBACK
+ --------
+ 
+@@ -107,9 +76,7 @@
+         If you haven't installed IO-Compress-Base then search IO::Compress::Base.pm
+         for a line like this:
+ 
+-          $VERSION = "2.008" ;
+-
+-
++          $VERSION = "2.015" ;
+ 
+  2. If you are having problems building IO-Compress-Base, send me a
+     complete log of what happened. Start by unpacking the IO-Compress-Base
+@@ -120,5 +87,4 @@
+         make
+         make test TEST_VERBOSE=1          
+ 
+-
+ Paul Marquess <pmqs at cpan.org>
+diff -urN perl-5.10.0.orig/ext/IO_Compress_Base/lib/File/GlobMapper.pm perl-5.10.0/ext/IO_Compress_Base/lib/File/GlobMapper.pm
+--- perl-5.10.0.orig/ext/IO_Compress_Base/lib/File/GlobMapper.pm	2007-12-18 11:47:07.000000000 +0100
++++ perl-5.10.0/ext/IO_Compress_Base/lib/File/GlobMapper.pm	2009-12-01 11:17:37.000000000 +0100
+@@ -26,7 +26,7 @@
  our ($Error);
  
  our ($VERSION, @EXPORT_OK);
@@ -88,7 +207,7 @@ diff -up perl-5.10.0/ext/IO_Compress_Bas
  @EXPORT_OK = qw( globmap );
  
  
-@@ -389,24 +389,6 @@ File::GlobMapper - Extend File Glob to A
+@@ -389,24 +389,6 @@
  
  =head1 DESCRIPTION
  
@@ -113,10 +232,10 @@ diff -up perl-5.10.0/ext/IO_Compress_Bas
  This module needs Perl5.005 or better.
  
  This module takes the existing C<File::Glob> module as a starting point and
-diff -up perl-5.10.0/ext/IO_Compress_Base/lib/IO/Compress/Base/Common.pm.xxx perl-5.10.0/ext/IO_Compress_Base/lib/IO/Compress/Base/Common.pm
---- perl-5.10.0/ext/IO_Compress_Base/lib/IO/Compress/Base/Common.pm.xxx	2007-12-18 11:47:07.000000000 +0100
-+++ perl-5.10.0/ext/IO_Compress_Base/lib/IO/Compress/Base/Common.pm	2008-09-03 15:17:32.000000000 +0200
-@@ -11,7 +11,7 @@ use File::GlobMapper;
+diff -urN perl-5.10.0.orig/ext/IO_Compress_Base/lib/IO/Compress/Base/Common.pm perl-5.10.0/ext/IO_Compress_Base/lib/IO/Compress/Base/Common.pm
+--- perl-5.10.0.orig/ext/IO_Compress_Base/lib/IO/Compress/Base/Common.pm	2007-12-18 11:47:07.000000000 +0100
++++ perl-5.10.0/ext/IO_Compress_Base/lib/IO/Compress/Base/Common.pm	2009-12-01 11:17:37.000000000 +0100
+@@ -11,7 +11,7 @@
  require Exporter;
  our ($VERSION, @ISA, @EXPORT, %EXPORT_TAGS, $HAS_ENCODE);
  @ISA = qw(Exporter);
@@ -125,7 +244,7 @@ diff -up perl-5.10.0/ext/IO_Compress_Bas
  
  @EXPORT = qw( isaFilehandle isaFilename whatIsInput whatIsOutput 
                isaFileGlobString cleanFileGlobString oneTarget
-@@ -192,7 +192,7 @@ sub oneTarget
+@@ -192,7 +192,7 @@
      return $_[0] =~ /^(code|handle|buffer|filename)$/;
  }
  
@@ -134,7 +253,7 @@ diff -up perl-5.10.0/ext/IO_Compress_Bas
  {
      my $class = shift ;
  
-@@ -320,7 +320,7 @@ sub Validator::new
+@@ -320,7 +320,7 @@
      return $obj ;
  }
  
@@ -143,7 +262,7 @@ diff -up perl-5.10.0/ext/IO_Compress_Bas
  {
      my $self   = shift ;
      ${ $self->{Error} } = shift ;
-@@ -328,7 +328,7 @@ sub Validator::saveErrorString
+@@ -328,7 +328,7 @@
[...10861 lines suppressed...]
-+If all your tests passed, Test::Simple will exit with zero (which is
-+normal).  If anything failed it will exit with how many failed.  If
-+you run less (or more) tests than you planned, the missing (or extras)
-+will be considered failures.  If no tests were ever run Test::Simple
-+will throw a warning and exit with 255.  If the test died, even after
-+having successfully completed all its tests, it will still be
-+considered a failure and will exit with 255.
-+
-+So the exit codes are...
-+
-+    0                   all tests successful
-+    255                 test died
-+    any other number    how many failed (including missing or extras)
-+
-+If you fail more than 254 tests, it will be reported as 254.
-+
-+This module is by no means trying to be a complete testing system.
-+It's just to get you started.  Once you're off the ground its
-+recommended you look at L<Test::More>.
-+
-+
-+=head1 EXAMPLE
-+
-+Here's an example of a simple .t file for the fictional Film module.
-+
-+    use Test::Simple tests => 5;
-+
-+    use Film;  # What you're testing.
-+
-+    my $btaste = Film->new({ Title    => 'Bad Taste',
-+                             Director => 'Peter Jackson',
-+                             Rating   => 'R',
-+                             NumExplodingSheep => 1
-+                           });
-+    ok( defined($btaste) && ref $btaste eq 'Film,     'new() works' );
-+
-+    ok( $btaste->Title      eq 'Bad Taste',     'Title() get'    );
-+    ok( $btaste->Director   eq 'Peter Jackson', 'Director() get' );
-+    ok( $btaste->Rating     eq 'R',             'Rating() get'   );
-+    ok( $btaste->NumExplodingSheep == 1,        'NumExplodingSheep() get' );
-+
-+It will produce output like this:
-+
-+    1..5
-+    ok 1 - new() works
-+    ok 2 - Title() get
-+    ok 3 - Director() get
-+    not ok 4 - Rating() get
-+    #    Failed test (t/film.t at line 14)
-+    ok 5 - NumExplodingSheep() get
-+    # Looks like you failed 1 tests of 5
-+
-+Indicating the Film::Rating() method is broken.
-+
-+
-+=head1 CAVEATS
-+
-+Test::Simple will only report a maximum of 254 failures in its exit
-+code.  If this is a problem, you probably have a huge test script.
-+Split it into multiple files.  (Otherwise blame the Unix folks for
-+using an unsigned short integer as the exit status).
-+
-+Because VMS's exit codes are much, much different than the rest of the
-+universe, and perl does horrible mangling to them that gets in my way,
-+it works like this on VMS.
-+
-+    0     SS$_NORMAL        all tests successful
-+    4     SS$_ABORT         something went wrong
-+
-+Unfortunately, I can't differentiate any further.
-+
-+
-+=head1 NOTES
-+
-+Test::Simple is B<explicitly> tested all the way back to perl 5.004.
-+
-+Test::Simple is thread-safe in perl 5.8.0 and up.
-+
-+=head1 HISTORY
-+
-+This module was conceived while talking with Tony Bowden in his
-+kitchen one night about the problems I was having writing some really
-+complicated feature into the new Testing module.  He observed that the
-+main problem is not dealing with these edge cases but that people hate
-+to write tests B<at all>.  What was needed was a dead simple module
-+that took all the hard work out of testing and was really, really easy
-+to learn.  Paul Johnson simultaneously had this idea (unfortunately,
-+he wasn't in Tony's kitchen).  This is it.
-+
-+
-+=head1 SEE ALSO
-+
-+=over 4
-+
-+=item L<Test::More>
-+
-+More testing functions!  Once you outgrow Test::Simple, look at
-+Test::More.  Test::Simple is 100% forward compatible with Test::More
-+(i.e. you can just use Test::More instead of Test::Simple in your
-+programs and things will still work).
-+
-+=item L<Test>
-+
-+The original Perl testing module.
-+
-+=item L<Test::Unit>
-+
-+Elaborate unit testing.
-+
-+=item L<Test::Inline>, L<SelfTest>
-+
-+Embed tests in your code!
-+
-+=item L<Test::Harness>
-+
-+Interprets the output of your test program.
-+
-+=back
-+
-+
-+=head1 AUTHORS
-+
-+Idea by Tony Bowden and Paul Johnson, code by Michael G Schwern
-+E<lt>schwern at pobox.comE<gt>, wardrobe by Calvin Klein.
-+
-+
-+=head1 COPYRIGHT
-+
-+Copyright 2001, 2002, 2004 by Michael G Schwern E<lt>schwern at pobox.comE<gt>.
-+
-+This program is free software; you can redistribute it and/or 
-+modify it under the same terms as Perl itself.
-+
-+See F<http://www.perl.com/perl/misc/Artistic.html>
-+
-+=cut
-+
-+1;
+     {
+         title "Testing $CompressClass and $UncompressClass";
+ 
+@@ -161,7 +163,6 @@
+ 
+ 
+             my $lex = new LexFile my $name ;
+-            #my $name = "/tmp/try.lzf";
+ 
+             my $hello = <<EOM ;
+ hello world
+@@ -322,7 +323,6 @@
+ 
+               ok $x->close, "  close" ;
+             }
+-            #exit;
+ 
+             is $uncomp, $hello, "  expected output" ;
+         }
+@@ -419,11 +419,11 @@
+               ok ! defined $x->fileno() ;
+               1 while $x->read($uncomp) > 0  ;
+ 
+-              ok $x->close ;
++              ok $x->close, "closed" ;
+             }
+ 
+-            is $uncomp, $hello ;
+-            ok $buffer eq $keep ;
++            is $uncomp, $hello, "got expected uncompressed data" ;
++            ok $buffer eq $keep, "compressed input not changed" ;
+         }
+ 
+         if ($CompressClass ne 'RawDeflate')
+@@ -434,8 +434,9 @@
+             my $buffer = '';
+             {
+               my $x ;
+-              ok $x = new $CompressClass(\$buffer) ;
+-              ok $x->close ;
++              $x = new $CompressClass(\$buffer);
++              ok $x, "new $CompressClass" ;
++              ok $x->close, "close ok" ;
+           
+             }
+ 
+@@ -541,7 +542,6 @@
+             read($fh1, $rest, 5000);
+             is $x->trailingData() . $rest, $trailer ;
+             #print "# [".$x->trailingData() . "][$rest]\n" ;
+-            #exit;
+ 
+         }
+ 
+@@ -1416,7 +1416,6 @@
+             }
+         }
+ 
+-
+         {
+             title "write tests - invalid data" ;
+ 


Index: perl.spec
===================================================================
RCS file: /cvs/extras/rpms/perl/F-12/perl.spec,v
retrieving revision 1.235
retrieving revision 1.236
diff -u -p -r1.235 -r1.236
--- perl.spec	30 Nov 2009 17:29:49 -0000	1.235
+++ perl.spec	1 Dec 2009 15:15:30 -0000	1.236
@@ -7,7 +7,7 @@
 
 Name:           perl
 Version:        %{perl_version}
-Release:        86%{?dist}
+Release:        87%{?dist}
 Epoch:          %{perl_epoch}
 Summary:        Practical Extraction and Report Language
 Group:          Development/Languages
@@ -239,17 +239,19 @@ Patch118:	perl-update-autodie.patch
 # cpan has it under PathTools-3.30
 Patch119:	perl-update-FileSpec.patch
 %define			    File_Spec_version 3.30
-Patch120:	perl-update-Compress_Raw_Zlib.patch
-%define			    Compress_Raw_Zlib 2.020
+Patch120:	perl-update-Compress-Raw-Zlib.patch
+%define			    Compress_Raw_Zlib_version 2.023
 Patch121:	perl-update-Scalar-List-Utils.patch
 %define			    Scalar_List_Utils 1.21
 Patch122:	perl-update-Module-Pluggable.patch
-%define             Module_Pluggable_version 3.90
+%define			    Module_Pluggable_version 3.90
 # Also fixes segfault when objects are reblessed (rt#33242, rhbz#459918)
 Patch123:	perl-update-Storable.patch
-%define             Storable_version 2.21
+%define			    Storable_version 2.21
 Patch124:	perl-update-IO-Compress-Base.patch
-%define             IO_Compress_Base 2.015
+%define			    IO_Compress_Base_version 2.015
+Patch125:	perl-update-IO-Compress-Zlib.patch
+%define			    IO_Compress_Zlib_version 2.015
 
 # Fedora uses links instead of lynx
 # patches File-Fetch and CPAN
@@ -425,7 +427,7 @@ Summary:        Low-Level Interface to t
 Group:          Development/Libraries
 License:        GPL+ or Artistic
 Epoch:          0
-Version:        2.008
+Version:        %{Compress_Raw_Zlib_version}
 Requires:       perl = %{perl_epoch}:%{perl_version}-%{release}
 
 %description Compress-Raw-Zlib
@@ -579,7 +581,7 @@ Summary:        Base Class for IO::Compr
 Group:          Development/Libraries
 License:        GPL+ or Artistic
 Epoch:          0
-Version:        2.015
+Version:        %{IO_Compress_Base_version}
 Requires:       perl = %{perl_epoch}:%{perl_version}-%{release}
 
 %description IO-Compress-Base
@@ -594,8 +596,7 @@ Summary:        Perl interface to allow 
 Group:          Development/Libraries
 License:        GPL+ or Artistic
 Epoch:          0
-# Really 1.23_01, but we drop the _01.
-Version:        2.008
+Version:        %{IO_Compress_Zlib_version}
 Requires:       perl = %{perl_epoch}:%{perl_version}-%{release}
 
 %description IO-Compress-Zlib
@@ -1031,11 +1032,12 @@ upstream tarball from perl.org.
 %patch120 -p1
 %patch121 -p1
 %patch122 -p1
-%patch123 -p1
-#%patch124 -p1
 # 0-byte files and patch don't seem to agree
 mkdir t/Module_Pluggable/lib/Zot/
 touch t/Module_Pluggable/lib/Zot/.Zork.pm
+%patch123 -p1
+%patch124 -p1
+%patch125 -p1
 
 
 %patch201 -p1
@@ -1315,11 +1317,12 @@ perl -x patchlevel.h \
 	'Fedora Patch117: Update Digest::SHA to %{Digest_SHA_version}' \
 	'Fedora Patch117: Update module autodie to %{autodie_version}' \
 	'Fedora Patch119: Update File::Spec to %{File_Spec_version}' \
-	'Fedora Patch120: Update Compress::Raw::Zlib to %{Compress_Raw_Zlib}' \
+	'Fedora Patch120: Update Compress::Raw::Zlib to %{Compress_Raw_Zlib_version}' \
 	'Fedora Patch121: Update Scalar-List-Utils to %{Scalar_List_Utils}' \
 	'Fedora Patch122: Update Module-Pluggable to %{Module_Pluggable_version}' \
 	'Fedora Patch123: Update Storable to %{Storable_version}' \
-        'Fedora Patch124: Update IO::Compress::Base to %{IO_Compress_Base}' \
+	'Fedora Patch124: Update IO::Compress::Base to %{IO_Compress_Base_version}' \
+	'Fedora Patch125: Update IO::Compress::Zlib to %{IO_Compress_Zlib_version}' \
 	'Fedora Patch201: Fedora uses links instead of lynx' \
 	%{nil}
 
@@ -1333,7 +1336,7 @@ rm -rf $RPM_BUILD_ROOT
 # work around a bug in Module::Build tests by setting TMPDIR to a directory
 # inside the source tree
 mkdir "$PWD/tmp"
-#TMPDIR="$PWD/tmp" make test
+TMPDIR="$PWD/tmp" make test
 %endif
 
 %post libs -p /sbin/ldconfig
@@ -1946,6 +1949,11 @@ mkdir "$PWD/tmp"
 
 # Old changelog entries are preserved in CVS.
 %changelog
+* Tue Dec  1 2009 Stepan Kasal <skasal at redhat.com> - 4:5.10.0-87
+- fix patch-update-Compress-Raw-Zlib.patch (did not patch Zlib.pm)
+- update Compress::Raw::Zlib to 2.023
+- update IO::Compress::Base, and IO::Compress::Zlib to 2.015 (#542645)
+
 * Mon Nov 30 2009 Marcela Mašláňová <mmaslano at redhat.com> - 4:5.10.0-86
 - 542645 update IO-Compress-Base
 


--- perl-update-Compress_Raw_Zlib.patch DELETED ---




More information about the fedora-extras-commits mailing list