diff --git a/perl-update-Compress-Raw-Zlib.patch b/perl-update-Compress-Raw-Zlib.patch new file mode 100644 index 0000000..52126d9 --- /dev/null +++ b/perl-update-Compress-Raw-Zlib.patch @@ -0,0 +1,1536 @@ +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 ') +- : () +- ), +- + 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 +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 for details about where to get + I). + +- +- + =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, C, C, and + C. + +-The default is Z_DEFAULT_COMPRESSION. ++The default is C. + + =item B<-Method> + +@@ -619,10 +633,18 @@ + + =item B<-WindowBits> + ++To compress an RFC 1950 data stream, set C to a positive ++number between 8 and 15. ++ ++To compress an RFC 1951 data stream, set C to C<-MAX_WBITS>. ++ ++To compress an RFC 1952 data stream (i.e. gzip), set C to ++C. ++ + For a definition of the meaning and valid values for C + refer to the I documentation for I. + +-Defaults to MAX_WBITS. ++Defaults to C. + + =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 optional +@@ -696,7 +716,6 @@ + my $d = new Compress::Raw::Zlib::Deflate ( -Bufsize => 300, + -Level => Z_BEST_SPEED ) ; + +- + =head2 B<$status = $d-Edeflate($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-EdeflateReset() > ++ ++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. ++ ++Returns C if successful. ++ + =head2 B<$status = $d-EdeflateParams([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. + +- + =back + + =head2 B<$status = $d-EdeflateTune($good_length, $max_lazy, $nice_length, $max_chain)> +@@ -815,7 +842,6 @@ + Returns the deflation strategy currently used. Valid values are + C, C and C. + +- + =head2 B<$d-Eget_Level()> + + Returns the compression level being used. +@@ -826,7 +852,6 @@ + + =head2 Example + +- + Here is a trivial example of using C. 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 to a positive +-number. ++number between 8 and 15. + + To uncompress an RFC 1951 data stream, set C to C<-MAX_WBITS>. + ++To uncompress an RFC 1952 data stream (i.e. gzip), set C to ++C. ++ ++To auto-detect and uncompress an RFC 1950 or RFC 1952 data stream (i.e. ++gzip), set C to C. ++ + For a full definition of the meaning and valid values for C + refer to the I documentation for I. + +-Defaults to MAX_WBITS. ++Defaults to C. + + =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-Einflate > 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 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 is used the size of the output buffer used will either ++be the value of the C 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 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 is enabled, the C option will also be ++enabled. ++ ++This option defaults to false. ++ ++See L for a discussion on why C 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 with C. + +- + =head2 B<$i-Edict_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. + +@@ -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 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 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 option ++you also get C 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 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 data ++in C<$input> and write I of the uncompressed data it has generated to ++C<$output>. This makes the interface to C much simpler - if the ++method has uncompressed C<$input> successfully I 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 will only trigger termination of ++the main processing loop if it isn't C. When C has not ++been used the C 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 I of the uncompressed data in C<$input> ++will have been processed. This means the subsequent call to C 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, 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 will keep allocating memory ++until I the uncompressed data has been written to the output buffer - ++the size of C<$output> is unbounded. ++ ++The C option is designed to help with this use-case. ++ ++The main difference in your code when using C is having to ++deal with cases where the C<$input> parameter still contains some ++uncompressed data that C hasn't processed yet. The status code ++returned from C will be C if uncompression took place and ++C if the output buffer is full. ++ ++Below is typical code that shows how to use C. ++ ++ 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 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 has returned a status other than C or ++C. This means that either the end of the compressed data ++stream has been reached (C) 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 option is automatically ++enabled when C 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, ++C and C. + + =head1 CONSTANTS + + All the I constants are automatically imported when you make use + of I. + +- + =head1 SEE ALSO + +-L, L, L, L, L, L, L, L, L, L, L, L, L, L, L ++L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L + + L + +@@ -1160,7 +1389,6 @@ + L, + L + +- + For RFC 1950, 1951 and 1952 see + F, + F and +@@ -1174,25 +1402,18 @@ + + The primary site for gzip is F. + +- +- +- + =head1 AUTHOR + + This module was written by Paul Marquess, F. + +- +- + =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; ++ ++ ++} ++ diff --git a/perl-update-Compress_Raw_Zlib.patch b/perl-update-Compress_Raw_Zlib.patch deleted file mode 100644 index fa2d857..0000000 --- a/perl-update-Compress_Raw_Zlib.patch +++ /dev/null @@ -1,864 +0,0 @@ -diff -up perl-5.10.0/ext/Compress/Raw/Zlib/Changes.cc perl-5.10.0/ext/Compress/Raw/Zlib/Changes ---- perl-5.10.0/ext/Compress/Raw/Zlib/Changes.cc 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/ext/Compress/Raw/Zlib/Changes 2009-06-03 10:42:12.000000000 +0200 -@@ -1,6 +1,62 @@ - CHANGES - ------- - -+ 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 -up perl-5.10.0/ext/Compress/Raw/Zlib/Makefile.PL.cc perl-5.10.0/ext/Compress/Raw/Zlib/Makefile.PL ---- perl-5.10.0/ext/Compress/Raw/Zlib/Makefile.PL.cc 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/ext/Compress/Raw/Zlib/Makefile.PL 2009-03-29 00:08:40.000000000 +0100 -@@ -77,24 +77,11 @@ WriteMakefile( - }, - - ( -- $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 ') -- : () -- ), -- - INSTALLDIRS => ($] >= 5.009 ? 'perl' : 'site'), - - ((ExtUtils::MakeMaker->VERSION() gt '6.30') ? -diff -up perl-5.10.0/ext/Compress/Raw/Zlib/pm_to_blib.cc perl-5.10.0/ext/Compress/Raw/Zlib/pm_to_blib -diff -up perl-5.10.0/ext/Compress/Raw/Zlib/private/MakeUtil.pm.cc perl-5.10.0/ext/Compress/Raw/Zlib/private/MakeUtil.pm ---- perl-5.10.0/ext/Compress/Raw/Zlib/private/MakeUtil.pm.cc 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/ext/Compress/Raw/Zlib/private/MakeUtil.pm 2008-09-02 15:14:33.000000000 +0200 -@@ -6,6 +6,8 @@ use strict ; - use Config qw(%Config); - use File::Copy; - -+my $VERSION = '1.0'; -+ - - BEGIN - { -@@ -47,6 +49,11 @@ sub MY::postamble - - my @files = getPerlFiles('MANIFEST'); - -+ # Note: Once you remove all the layers of shell/makefile escaping -+ # the regular expression below reads -+ # -+ # /^\s*local\s*\(\s*\$^W\s*\)/ -+ # - my $postamble = ' - - MyTrebleCheck: -@@ -290,6 +297,83 @@ sub doUpDownViaCopy - } - } - -+ -+sub FindBrokenDependencies -+{ -+ my $version = shift ; -+ my %thisModule = map { $_ => 1} @_; -+ -+ my @modules = qw( -+ IO::Compress::Base -+ IO::Compress::Base::Common -+ IO::Uncompress::Base -+ -+ Compress::Raw::Zlib -+ Compress::Raw::Bzip2 -+ -+ IO::Compress::RawDeflate -+ IO::Uncompress::RawInflate -+ IO::Compress::Deflate -+ IO::Uncompress::Inflate -+ IO::Compress::Gzip -+ IO::Compress::Gzip::Constants -+ IO::Uncompress::Gunzip -+ IO::Compress::Zip -+ IO::Uncompress::Unzip -+ -+ IO::Compress::Bzip2 -+ IO::Uncompress::Bunzip2 -+ -+ IO::Compress::Lzf -+ IO::Uncompress::UnLzf -+ -+ IO::Compress::Lzop -+ IO::Uncompress::UnLzop -+ -+ Compress::Zlib -+ ); -+ -+ my @broken = (); -+ -+ foreach my $module ( grep { ! $thisModule{$_} } @modules) -+ { -+ my $hasVersion = getInstalledVersion($module); -+ -+ # No need to upgrade if the module isn't installed at all -+ next -+ if ! defined $hasVersion; -+ -+ # If already have C::Z version 1, then an upgrade to any of the -+ # IO::Compress modules will not break it. -+ next -+ if $module eq 'Compress::Zlib' && $hasVersion < 2; -+ -+ if ($hasVersion < $version) -+ { -+ push @broken, $module -+ } -+ } -+ -+ return @broken; -+} -+ -+sub getInstalledVersion -+{ -+ my $module = shift; -+ my $version; -+ -+ eval " require $module; "; -+ -+ if ($@ eq '') -+ { -+ no strict 'refs'; -+ $version = ${ $module . "::VERSION" }; -+ $version = 0 -+ } -+ -+ return $version; -+} -+ - package MakeUtil ; - - 1; -diff -up perl-5.10.0/ext/Compress/Raw/Zlib/README.cc perl-5.10.0/ext/Compress/Raw/Zlib/README ---- perl-5.10.0/ext/Compress/Raw/Zlib/README.cc 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/ext/Compress/Raw/Zlib/README 2009-06-03 10:36:58.000000000 +0200 -@@ -1,16 +1,14 @@ - - Compress-Raw-Zlib - -- Version 2.008 -+ Version 2.020 - -- 2nd November 2007 -+ 3rd June 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 @@ using this sequence of commands: - make - make test - -- -- - INSTALLATION - ------------ - -@@ -70,9 +54,6 @@ To install Compress-Raw-Zlib, run the co - - make install - -- -- -- - Controlling the version of zlib used by Compress-Raw-Zlib - ---------------------------------------------------------- - -@@ -92,7 +73,6 @@ zlib library is used: - 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 @@ three options is actually used. This fil - step of the build, so remember to make any required changes to config.in - before building this module. - -- -- - Option 1 - -------- - -@@ -169,10 +147,9 @@ Setting the Gzip OS Code - ------------------------ - - 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 @@ If you find you have to change this valu - 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 @@ may vary. - 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 @@ I've had a report that when building Com - is necessary to have first built the zlib library with the -fpic - option. - -- -- -- -- - Linux Notes - ----------- - -@@ -307,9 +298,6 @@ This usually means that you have not ins - for zlib. Check for an RPM that start with "zlib-devel" in your Linux - distribution. - -- -- -- - Win32 Notes - ----------- - -@@ -318,15 +306,11 @@ it ships with a pre-compiled version of - 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 @@ Windows. - The workaround is to install Compress-Raw-Zlib manually using the - instructions given at the start of this file. - -- - FEEDBACK - -------- - -@@ -372,8 +355,7 @@ To help me help you, I need all of the f - If you haven't installed Compress-Raw-Zlib then search Compress::Raw::Zlib.pm - for a line like this: - -- $VERSION = "2.008" ; -- -+ $VERSION = "2.020" ; - - c. The version of zlib you have used. - If you have successfully installed Compress-Raw-Zlib, this one-liner -@@ -381,10 +363,8 @@ To help me help you, I need all of the f - - 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 @@ To help me help you, I need all of the f - make - make test TEST_VERBOSE=1 - -- - Paul Marquess -diff -up perl-5.10.0/ext/Compress/Raw/Zlib/typemap.cc perl-5.10.0/ext/Compress/Raw/Zlib/typemap -diff -up perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/adler32.c.cc perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/adler32.c -diff -up perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/compress.c.cc perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/compress.c -diff -up perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/crc32.c.cc perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/crc32.c -diff -up perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/crc32.h.cc perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/crc32.h -diff -up perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/deflate.c.cc perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/deflate.c -diff -up perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/deflate.h.cc perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/deflate.h -diff -up perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/infback.c.cc perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/infback.c -diff -up perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/inffast.c.cc perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/inffast.c -diff -up perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/inffast.h.cc perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/inffast.h -diff -up perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/inffixed.h.cc perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/inffixed.h -diff -up perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/inflate.c.cc perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/inflate.c -diff -up perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/inflate.h.cc perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/inflate.h -diff -up perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/inftrees.c.cc perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/inftrees.c -diff -up perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/inftrees.h.cc perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/inftrees.h -diff -up perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/trees.c.cc perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/trees.c -diff -up perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/trees.h.cc perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/trees.h -diff -up perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/uncompr.c.cc perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/uncompr.c -diff -up perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/zconf.h.cc perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/zconf.h -diff -up perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/zlib.h.cc perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/zlib.h -diff -up perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/zutil.c.cc perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/zutil.c -diff -up perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/zutil.h.cc perl-5.10.0/ext/Compress/Raw/Zlib/zlib-src/zutil.h -diff -up perl-5.10.0/ext/Compress/Raw/Zlib/Zlib.xs.cc perl-5.10.0/ext/Compress/Raw/Zlib/Zlib.xs ---- perl-5.10.0/ext/Compress/Raw/Zlib/Zlib.xs.cc 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/ext/Compress/Raw/Zlib/Zlib.xs 2009-03-26 10:40:57.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 @@ typedef struct di_stream { - #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 @@ typedef di_stream * Compress__Raw__Zlib_ - #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 @@ DispStream(s, message) - 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 @@ PostInitStream(s, flags, bufsize, window - - 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 @@ char * string; - 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 @@ char * string; - - 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 @@ char * string ; - 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 @@ _inflateInit(flags, windowBits, bufsize, - 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 @@ inflate (s, buf, output, eof=FALSE) - 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 @@ inflate (s, buf, output, eof=FALSE) - 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 @@ inflate (s, buf, output, eof=FALSE) - 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 @@ inflate (s, buf, output, eof=FALSE) - 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 @@ inflate (s, buf, output, eof=FALSE) - #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 @@ inflate (s, buf, output, eof=FALSE) - 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 @@ inflate (s, buf, output, eof=FALSE) - *SvEND(buf) = '\0'; - SvSETMAGIC(buf); - } -+ - } - OUTPUT: - RETVAL -diff -up perl-5.10.0/lib/Compress/Raw/FAQ.pod.cc perl-5.10.0/lib/Compress/Raw/FAQ.pod ---- perl-5.10.0/lib/Compress/Raw/FAQ.pod.cc 2009-06-08 12:36:21.579210608 +0200 -+++ perl-5.10.0/lib/Compress/Raw/FAQ.pod 2009-06-03 10:37:02.000000000 +0200 -@@ -0,0 +1,142 @@ -+ -+=head1 NAME -+ -+Compress::Raw::Zlib::FAQ -- Frequently Asked Questions about Compress::Raw::Zlib -+ -+=head1 DESCRIPTION -+ -+Common questions answered. -+ -+=head2 Compatibility with Unix compress/uncompress. -+ -+This module is not compatible with Unix C. -+ -+If you have the C program available, you can use this to read -+compressed files -+ -+ open F, "uncompress -c $filename |"; -+ while () -+ { -+ ... -+ -+Alternatively, if you have the C program available, you can use -+this to read compressed files -+ -+ open F, "gunzip -c $filename |"; -+ while () -+ { -+ ... -+ -+and this to write compress files, if you have the C program -+available -+ -+ open F, "| compress -c $filename "; -+ print F "data"; -+ ... -+ close F ; -+ -+=head2 Accessing .tar.Z files -+ -+See previous FAQ item. -+ -+If the C module is installed and either the C or -+C programs are available, you can use one of these workarounds to -+read C<.tar.Z> files. -+ -+Firstly with C -+ -+ use strict; -+ use warnings; -+ use Archive::Tar; -+ -+ open F, "uncompress -c $filename |"; -+ my $tar = Archive::Tar->new(*F); -+ ... -+ -+and this with C -+ -+ use strict; -+ use warnings; -+ use Archive::Tar; -+ -+ open F, "gunzip -c $filename |"; -+ my $tar = Archive::Tar->new(*F); -+ ... -+ -+Similarly, if the C program is available, you can use this to -+write a C<.tar.Z> file -+ -+ use strict; -+ use warnings; -+ use Archive::Tar; -+ use IO::File; -+ -+ my $fh = new IO::File "| compress -c >$filename"; -+ my $tar = Archive::Tar->new(); -+ ... -+ $tar->write($fh); -+ $fh->close ; -+ -+=head2 Accessing Zip Files -+ -+This module does not support reading/writing zip files. -+ -+Support for reading/writing zip files is included with the -+C and C modules. -+ -+The primary focus of the C and C -+modules is to provide an C compatible streaming read/write -+interface to zip files/buffers. They are not fully flegged archivers. If -+you are looking for an archiver check out the C module. You -+can find it on CPAN at -+ -+ http://www.cpan.org/modules/by-module/Archive/Archive-Zip-*.tar.gz -+ -+=head2 Zlib Library Version Support -+ -+By default C will build with a private copy of version -+1.2.3 of the zlib library. (See the F file for details of -+how to override this behaviour) -+ -+If you decide to use a different version of the zlib library, you need to be -+aware of the following issues -+ -+=over 5 -+ -+=item * -+ -+First off, you must have zlib 1.0.5 or better. -+ -+=item * -+ -+You need to have zlib 1.2.1 or better if you want to use the C<-Merge> -+option with C, C and -+C. -+ -+=back -+ -+=head1 SEE ALSO -+ -+L, L, L, L, L, L, L, L, L, L, L, L, L, L, L -+ -+L -+ -+L, L, -+L, -+L -+ -+=head1 AUTHOR -+ -+This module was written by Paul Marquess, F. -+ -+=head1 MODIFICATION HISTORY -+ -+See the Changes file. -+ -+=head1 COPYRIGHT AND LICENSE -+ -+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 --git a/perl-update-IO-Compress-Base.patch b/perl-update-IO-Compress-Base.patch new file mode 100644 index 0000000..b8dc888 --- /dev/null +++ b/perl-update-IO-Compress-Base.patch @@ -0,0 +1,1475 @@ +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 + ------- + ++ 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.013 18 July 2008 ++ ++ * IO::Compress::Base ++ - Allow IO::Compress::Base::Parameters::parse to accept an IO::Compress::Base::Parameters object. ++ ++ 2.012 15 July 2008 ++ ++ * IO::Compress::Base ++ - Silenced an uninitialised value warning when reading a line ++ at a time from a zip file where the content uses ZIP_CM_STORE. ++ [Problem spotted & fixed by Jeff Holt] ++ ++ * IO::Compress::Base & IO::Uncompress::Base ++ - local-ise $!, $? et al in the DESTROY methods. ++ ++ 2.011 17 May 2008 ++ ++ * IO::Compress::Base ++ - Fixed problem that prevented the creation of a zip file that ++ contained more than one compression method. ++ ++ * IO::Compress::Base::Common ++ - The private Validator class in this module clashes with another ++ CPAN module. Moved Validator into the IO::Compress::Base::Common ++ namespace. ++ [RT #35954] ++ ++ 2.010 5 May 2008 ++ ++ * Fixed problem that meant Perl 5.10 could not upgrade this module. ++ [RT #35342] ++ ++ 2.009 20 April 2008 ++ ++ * Removed the alpha status from File::GlobMapper ++ ++ * IO::Compress::Base ++ When writing output never output a zero length buffer. ++ Done to improve interoperability with other tied filenandle ++ modules. ++ ++ * Changed IO::Uncompress::Base to not use the offset parameter of ++ the read method when reading from a filehandle. ++ ++ The object returned from Net::FTP::retr implements a non-standard ++ read method. The third parameter is used for a timeout value ++ rather than an offset. ++ [rt.cpan#33231] ++ ++ * Changed IO::Uncompress::Base to not use the eof method when ++ reading from a filehandle. ++ ++ The object returned from Net::FTP::retr implements both the read ++ method and the eof method. Unfortunately the implementation of ++ the read method uses non-buffered IO (by using sysread) while ++ the eof method uses buffered IO. Mixing buffered and non-buffered ++ IO results in data corruption. ++ + 2.008 2 November 2007 + + * Minor documentation changes in README +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 +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); +-$VERSION = '0.000_02'; ++$VERSION = '1.000'; + @EXPORT_OK = qw( globmap ); + + +@@ -389,24 +389,6 @@ + + =head1 DESCRIPTION + +-B +- +-=over 5 +- +-=item * This code is a work in progress. +- +-=item * There are known bugs. +- +-=item * The interface defined here is tentative. +- +-=item * There are portability issues. +- +-=item * Do not use in production code. +- +-=item * Consider yourself warned! +- +-=back +- + This module needs Perl5.005 or better. + + This module takes the existing C module as a starting point and +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); +-$VERSION = '2.008'; ++$VERSION = '2.015'; + + @EXPORT = qw( isaFilehandle isaFilename whatIsInput whatIsOutput + isaFileGlobString cleanFileGlobString oneTarget +@@ -192,7 +192,7 @@ + return $_[0] =~ /^(code|handle|buffer|filename)$/; + } + +-sub Validator::new ++sub IO::Compress::Base::Validator::new + { + my $class = shift ; + +@@ -320,7 +320,7 @@ + return $obj ; + } + +-sub Validator::saveErrorString ++sub IO::Compress::Base::Validator::saveErrorString + { + my $self = shift ; + ${ $self->{Error} } = shift ; +@@ -328,7 +328,7 @@ + + } + +-sub Validator::croakError ++sub IO::Compress::Base::Validator::croakError + { + my $self = shift ; + $self->saveErrorString($_[0]); +@@ -337,7 +337,7 @@ + + + +-sub Validator::validateInputFilenames ++sub IO::Compress::Base::Validator::validateInputFilenames + { + my $self = shift ; + +@@ -367,7 +367,7 @@ + return 1 ; + } + +-sub Validator::validateInputArray ++sub IO::Compress::Base::Validator::validateInputArray + { + my $self = shift ; + +@@ -398,7 +398,7 @@ + return 1 ; + } + +-#sub Validator::validateHash ++#sub IO::Compress::Base::Validator::validateHash + #{ + # my $self = shift ; + # my $href = shift ; +@@ -485,7 +485,11 @@ + + my $sub = (caller($level + 1))[3] ; + local $Carp::CarpLevel = 1 ; +- my $p = new IO::Compress::Base::Parameters() ; ++ ++ return $_[1] ++ if @_ == 2 && defined $_[1] && UNIVERSAL::isa($_[1], "IO::Compress::Base::Parameters"); ++ ++ my $p = new IO::Compress::Base::Parameters() ; + $p->parse(@_) + or croak "$sub: $p->{Error}" ; + +@@ -534,6 +538,7 @@ + + my $got = $self->{Got} ; + my $firstTime = keys %{ $got } == 0 ; ++ my $other; + + my (@Bad) ; + my @entered = () ; +@@ -544,7 +549,8 @@ + @entered = () ; + } + elsif (@_ == 1) { +- my $href = $_[0] ; ++ my $href = $_[0] ; ++ + return $self->setError("Expected even number of parameters, got 1") + if ! defined $href or ! ref $href or ref $href ne "HASH" ; + +@@ -559,8 +565,13 @@ + if $count % 2 != 0 ; + + for my $i (0.. $count / 2 - 1) { +- push @entered, $_[2* $i] ; +- push @entered, \$_[2* $i+1] ; ++ if ($_[2 * $i] eq '__xxx__') { ++ $other = $_[2 * $i + 1] ; ++ } ++ else { ++ push @entered, $_[2 * $i] ; ++ push @entered, \$_[2 * $i + 1] ; ++ } + } + } + +@@ -588,6 +599,24 @@ + } + + my %parsed = (); ++ ++ if ($other) ++ { ++ for my $key (keys %$default) ++ { ++ my $canonkey = lc $key; ++ if ($other->parsed($canonkey)) ++ { ++ my $value = $other->value($canonkey); ++#print "SET '$canonkey' to $value [$$value]\n"; ++ ++ $parsed{$canonkey}; ++ $got->{$canonkey}[OFF_PARSED] = 1; ++ $got->{$canonkey}[OFF_DEFAULT] = $value; ++ $got->{$canonkey}[OFF_FIXED] = $value; ++ } ++ } ++ } ++ + for my $i (0.. @entered / 2 - 1) { + my $key = $entered[2* $i] ; + my $value = $entered[2* $i+1] ; +diff -urN perl-5.10.0.orig/ext/IO_Compress_Base/lib/IO/Compress/Base.pm perl-5.10.0/ext/IO_Compress_Base/lib/IO/Compress/Base.pm +--- perl-5.10.0.orig/ext/IO_Compress_Base/lib/IO/Compress/Base.pm 2007-12-18 11:47:07.000000000 +0100 ++++ perl-5.10.0/ext/IO_Compress_Base/lib/IO/Compress/Base.pm 2009-12-01 11:17:37.000000000 +0100 +@@ -6,7 +6,7 @@ + use strict ; + use warnings; + +-use IO::Compress::Base::Common 2.008 ; ++use IO::Compress::Base::Common 2.015 ; + + use IO::File ; + use Scalar::Util qw(blessed readonly); +@@ -20,7 +20,7 @@ + our (@ISA, $VERSION); + @ISA = qw(Exporter IO::File); + +-$VERSION = '2.008'; ++$VERSION = '2.015'; + + #Can't locate object method "SWASHNEW" via package "utf8" (perhaps you forgot to load "utf8"?) at .../ext/Compress-Zlib/Gzip/blib/lib/Compress/Zlib/Common.pm line 16. + +@@ -120,12 +120,14 @@ + &{ *$self->{FilterEnvelope} }(); + } + +- if ( defined *$self->{FH} ) { +- defined *$self->{FH}->write( $data, length $data ) +- or return $self->saveErrorString(0, $!, $!); +- } +- else { +- ${ *$self->{Buffer} } .= $data ; ++ if (length $data) { ++ if ( defined *$self->{FH} ) { ++ defined *$self->{FH}->write( $data, length $data ) ++ or return $self->saveErrorString(0, $!, $!); ++ } ++ else { ++ ${ *$self->{Buffer} } .= $data ; ++ } + } + + return 1; +@@ -234,7 +236,7 @@ + my $status ; + if (! $merge) + { +- *$obj->{Compress} = $obj->mkComp($class, $got) ++ *$obj->{Compress} = $obj->mkComp($got) + or return undef; + + *$obj->{UnCompSize} = new U64 ; +@@ -321,7 +323,7 @@ + my $haveOut = @_ ; + my $output = shift ; + +- my $x = new Validator($class, *$obj->{Error}, $name, $input, $output) ++ my $x = new IO::Compress::Base::Validator($class, *$obj->{Error}, $name, $input, $output) + or return undef ; + + push @_, $output if $haveOut && $x->{Hash}; +@@ -545,6 +547,8 @@ + sub DESTROY + { + my $self = shift ; ++ local ($., $@, $!, $^E, $?); ++ + $self->close() ; + + # TODO - memory leak with 5.8.0 - this isn't called until +@@ -697,15 +701,13 @@ + $self->ckParams($got) + or $self->croakError("newStream: $self->{Error}"); + ++ *$self->{Compress} = $self->mkComp($got) ++ or return 0; ++ + *$self->{Header} = $self->mkHeader($got) ; + $self->output(*$self->{Header} ) + or return 0; + +- my $status = $self->reset() ; +- return $self->saveErrorString(0, *$self->{Compress}{Error}, +- *$self->{Compress}{ErrorNo}) +- if $status == STATUS_ERROR; +- + *$self->{UnCompSize}->reset(); + *$self->{CompSize}->reset(); + +@@ -939,23 +941,17 @@ + + =head1 NAME + +- + IO::Compress::Base - Base Class for IO::Compress modules + +- + =head1 SYNOPSIS + + use IO::Compress::Base ; + + =head1 DESCRIPTION + +- + This module is not intended for direct use in application code. Its sole + purpose if to to be sub-classed by IO::Compress modules. + +- +- +- + =head1 SEE ALSO + + L, L, L, L, L, L, L, L, L, L, L, L, L, L, L +@@ -966,25 +962,18 @@ + L, + L + +- +- +- +- + =head1 AUTHOR + + This module was written by Paul Marquess, F. + +- +- + =head1 MODIFICATION HISTORY + + See the Changes file. + + =head1 COPYRIGHT AND LICENSE + +-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. + +- +diff -urN perl-5.10.0.orig/ext/IO_Compress_Base/lib/IO/Uncompress/AnyUncompress.pm perl-5.10.0/ext/IO_Compress_Base/lib/IO/Uncompress/AnyUncompress.pm +--- perl-5.10.0.orig/ext/IO_Compress_Base/lib/IO/Uncompress/AnyUncompress.pm 2007-12-18 11:47:07.000000000 +0100 ++++ perl-5.10.0/ext/IO_Compress_Base/lib/IO/Uncompress/AnyUncompress.pm 2009-12-01 11:17:37.000000000 +0100 +@@ -4,16 +4,16 @@ + use warnings; + use bytes; + +-use IO::Compress::Base::Common 2.008 qw(createSelfTiedObject); ++use IO::Compress::Base::Common 2.015 qw(createSelfTiedObject); + +-use IO::Uncompress::Base 2.008 ; ++use IO::Uncompress::Base 2.015 ; + + + require Exporter ; + + our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $AnyUncompressError); + +-$VERSION = '2.008'; ++$VERSION = '2.015'; + $AnyUncompressError = ''; + + @ISA = qw( Exporter IO::Uncompress::Base ); +@@ -27,18 +27,18 @@ + + BEGIN + { +- eval ' use IO::Uncompress::Adapter::Inflate 2.008 ;'; +- eval ' use IO::Uncompress::Adapter::Bunzip2 2.008 ;'; +- eval ' use IO::Uncompress::Adapter::LZO 2.008 ;'; +- eval ' use IO::Uncompress::Adapter::Lzf 2.008 ;'; +- +- eval ' use IO::Uncompress::Bunzip2 2.008 ;'; +- eval ' use IO::Uncompress::UnLzop 2.008 ;'; +- eval ' use IO::Uncompress::Gunzip 2.008 ;'; +- eval ' use IO::Uncompress::Inflate 2.008 ;'; +- eval ' use IO::Uncompress::RawInflate 2.008 ;'; +- eval ' use IO::Uncompress::Unzip 2.008 ;'; +- eval ' use IO::Uncompress::UnLzf 2.008 ;'; ++ eval ' use IO::Uncompress::Adapter::Inflate 2.015 ;'; ++ eval ' use IO::Uncompress::Adapter::Bunzip2 2.015 ;'; ++ eval ' use IO::Uncompress::Adapter::LZO 2.015 ;'; ++ eval ' use IO::Uncompress::Adapter::Lzf 2.015 ;'; ++ ++ eval ' use IO::Uncompress::Bunzip2 2.015 ;'; ++ eval ' use IO::Uncompress::UnLzop 2.015 ;'; ++ eval ' use IO::Uncompress::Gunzip 2.015 ;'; ++ eval ' use IO::Uncompress::Inflate 2.015 ;'; ++ eval ' use IO::Uncompress::RawInflate 2.015 ;'; ++ eval ' use IO::Uncompress::Unzip 2.015 ;'; ++ eval ' use IO::Uncompress::UnLzf 2.015 ;'; + } + + sub new +@@ -56,7 +56,7 @@ + + sub getExtraParams + { +- use IO::Compress::Base::Common 2.008 qw(:Parse); ++ use IO::Compress::Base::Common 2.015 qw(:Parse); + return ( 'RawInflate' => [1, 1, Parse_boolean, 0] ) ; + } + +@@ -75,7 +75,6 @@ + sub mkUncomp + { + my $self = shift ; +- my $class = shift ; + my $got = shift ; + + my $magic ; +@@ -188,10 +187,8 @@ + + =head1 NAME + +- + IO::Uncompress::AnyUncompress - Uncompress gzip, zip, bzip2 or lzop file/buffer + +- + =head1 SYNOPSIS + + use IO::Uncompress::AnyUncompress qw(anyuncompress $AnyUncompressError) ; +@@ -235,10 +232,8 @@ + eof($z) + close($z) + +- + =head1 DESCRIPTION + +- + This module provides a Perl interface that allows the reading of + files/buffers that have been compressed with a variety of compression + libraries. +@@ -266,9 +261,6 @@ + The module will auto-detect which, if any, of the supported + compression formats is being used. + +- +- +- + =head1 Functional Interface + + A top-level function, C, is provided to carry out +@@ -281,14 +273,10 @@ + anyuncompress $input => $output [,OPTS] + or die "anyuncompress failed: $AnyUncompressError\n"; + +- +- + The functional interface needs Perl5.005 or better. + +- + =head2 anyuncompress $input => $output [, OPTS] + +- + C expects at least two parameters, C<$input> and C<$output>. + + =head3 The C<$input> parameter +@@ -327,8 +315,6 @@ + The complete array will be walked to ensure that it only + contains valid filenames before any data is uncompressed. + +- +- + =item An Input FileGlob string + + If C<$input> is a string that is delimited by the characters "<" and ">" +@@ -339,13 +325,10 @@ + + See L for more details. + +- + =back + + If the C<$input> parameter is any other type, C will be returned. + +- +- + =head3 The C<$output> parameter + + The parameter C<$output> is used to control the destination of the +@@ -365,14 +348,11 @@ + will be written to it. + The string '-' can be used as an alias for standard output. + +- + =item A scalar reference + + If C<$output> is a scalar reference, the uncompressed data will be + stored in C<$$output>. + +- +- + =item An Array Reference + + If C<$output> is an array reference, the uncompressed data will be +@@ -391,20 +371,13 @@ + + If the C<$output> parameter is any other type, C will be returned. + +- +- + =head2 Notes + +- + When C<$input> maps to multiple compressed files/buffers and C<$output> is + a single file/buffer, after uncompression C<$output> will contain a + concatenation of all the uncompressed data from each of the input + files/buffers. + +- +- +- +- + =head2 Optional Parameters + + Unless specified below, the optional parameters for C, +@@ -424,7 +397,6 @@ + + This parameter defaults to 0. + +- + =item C<< BinModeOut => 0|1 >> + + When writing to a file or filehandle, set C before writing to the +@@ -432,26 +404,17 @@ + + Defaults to 0. + +- +- +- +- + =item C<< Append => 0|1 >> + + TODO + + =item C<< MultiStream => 0|1 >> + +- + If the input file/buffer contains multiple compressed data streams, this + option will uncompress the whole lot as a single data stream. + + Defaults to 0. + +- +- +- +- + =item C<< TrailingData => $scalar >> + + Returns the data, if any, that is present immediately after the compressed +@@ -471,19 +434,12 @@ + + Don't bother using C if the input is a filename. + +- +- + If you know the length of the compressed data stream before you start + uncompressing, you can avoid having to use C by setting the + C option. + +- +- + =back + +- +- +- + =head2 Examples + + To read the contents of the file C and write the +@@ -498,7 +454,6 @@ + anyuncompress $input => $output + or die "anyuncompress failed: $AnyUncompressError\n"; + +- + To read from an existing Perl filehandle, C<$input>, and write the + uncompressed data to a buffer, C<$buffer>. + +@@ -542,7 +497,6 @@ + + The format of the constructor for IO::Uncompress::AnyUncompress is shown below + +- + my $z = new IO::Uncompress::AnyUncompress $input [OPTS] + or die "IO::Uncompress::AnyUncompress failed: $AnyUncompressError\n"; + +@@ -574,7 +528,6 @@ + read from it. + The string '-' can be used as an alias for standard input. + +- + =item A scalar reference + + If C<$input> is a scalar reference, the compressed data will be read from +@@ -584,7 +537,6 @@ + + =head2 Constructor Options + +- + The option names defined below are case insensitive and can be optionally + prefixed by a '-'. So all of the following are valid + +@@ -608,8 +560,6 @@ + + =item C<< MultiStream => 0|1 >> + +- +- + Allows multiple concatenated compressed streams to be treated as a single + compressed stream. Decompression will stop once either the end of the + file/buffer is reached, an error is encountered (premature eof, corrupt +@@ -618,7 +568,6 @@ + + This parameter defaults to 0. + +- + =item C<< Prime => $string >> + + This option will uncompress the contents of C<$string> before processing the +@@ -660,8 +609,6 @@ + the file pointer will be left pointing to the first byte directly after the + compressed data stream. + +- +- + This option defaults to off. + + =item C<< Append => 0|1 >> +@@ -678,24 +625,12 @@ + + =item C<< Strict => 0|1 >> + +- +- + This option controls whether the extra checks defined below are used when + carrying out the decompression. When Strict is on, the extra tests are + carried out, when Strict is off they are not. + + The default for this option is off. + +- +- +- +- +- +- +- +- +- +- + =item C<< RawInflate => 0|1 >> + + When auto-detecting the compressed format, try to test for raw-deflate (RFC +@@ -707,11 +642,6 @@ + + Defaults to 0. + +- +- +- +- +- + =back + + =head2 Examples +@@ -755,7 +685,6 @@ + Returns the number of uncompressed bytes written to C<$buffer>, zero if eof + or a negative number on error. + +- + =head2 getline + + Usage is +@@ -770,7 +699,6 @@ + determine what constitutes an end of line. Paragraph mode, record mode and + file slurp mode are all supported. + +- + =head2 getc + + Usage is +@@ -785,9 +713,6 @@ + + $char = $z->ungetc($string) + +- +- +- + =head2 getHeaderInfo + + Usage is +@@ -799,9 +724,6 @@ + or hash references (in array context) that contains information about each + of the header fields in the compressed data stream(s). + +- +- +- + =head2 tell + + Usage is +@@ -818,26 +740,17 @@ + $z->eof(); + eof($z); + +- +- + Returns true if the end of the compressed input stream has been reached. + +- +- + =head2 seek + + $z->seek($position, $whence); + seek($z, $position, $whence); + +- +- +- + Provides a sub-set of the C functionality, with the restriction + that it is only legal to seek forward in the input file/buffer. + It is a fatal error to attempt to seek backward. + +- +- + The C<$whence> parameter takes one the usual values, namely SEEK_SET, + SEEK_CUR or SEEK_END. + +@@ -879,8 +792,6 @@ + $z->input_line_number() + $z->input_line_number(EXPR) + +- +- + Returns the current uncompressed line number. If C is present it has + the effect of setting the line number. Note that setting the line number + does not change the current position within the file/buffer being read. +@@ -888,30 +799,25 @@ + The contents of C<$/> are used to to determine what constitutes a line + terminator. + +- +- + =head2 fileno + + $z->fileno() + fileno($z) + +-If the C<$z> object is associated with a file or a filehandle, this method +-will return the underlying file descriptor. ++If the C<$z> object is associated with a file or a filehandle, C ++will return the underlying file descriptor. Once the C method is ++called C will return C. + +-If the C<$z> object is is associated with a buffer, this method will +-return undef. ++If the C<$z> object is is associated with a buffer, this method will return ++C. + + =head2 close + + $z->close() ; + close $z ; + +- +- + Closes the output file/buffer. + +- +- + For most versions of Perl this method will be automatically invoked if + the IO::Uncompress::AnyUncompress object is destroyed (either explicitly or by the + variable with the reference to the object going out of scope). The +@@ -930,9 +836,6 @@ + object was created, and the object is associated with a file, the + underlying file will also be closed. + +- +- +- + =head2 nextStream + + Usage is +@@ -971,8 +874,6 @@ + + Don't bother using C if the input is a filename. + +- +- + If you know the length of the compressed data stream before you start + uncompressing, you can avoid having to use C by setting the + C option in the constructor. +@@ -994,9 +895,6 @@ + + =head1 EXAMPLES + +- +- +- + =head1 SEE ALSO + + L, L, L, L, L, L, L, L, L, L, L, L, L, L +@@ -1007,23 +905,17 @@ + L, + L + +- +- +- +- + =head1 AUTHOR + + This module was written by Paul Marquess, F. + +- +- + =head1 MODIFICATION HISTORY + + See the Changes file. + + =head1 COPYRIGHT AND LICENSE + +-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. +diff -urN perl-5.10.0.orig/ext/IO_Compress_Base/lib/IO/Uncompress/Base.pm perl-5.10.0/ext/IO_Compress_Base/lib/IO/Uncompress/Base.pm +--- perl-5.10.0.orig/ext/IO_Compress_Base/lib/IO/Uncompress/Base.pm 2007-12-18 11:47:07.000000000 +0100 ++++ perl-5.10.0/ext/IO_Compress_Base/lib/IO/Uncompress/Base.pm 2009-12-01 11:17:37.000000000 +0100 +@@ -9,12 +9,12 @@ + @ISA = qw(Exporter IO::File); + + +-$VERSION = '2.008'; ++$VERSION = '2.015'; + + use constant G_EOF => 0 ; + use constant G_ERR => -1 ; + +-use IO::Compress::Base::Common 2.008 ; ++use IO::Compress::Base::Common 2.015 ; + #use Parse::Parameters ; + + use IO::File ; +@@ -28,6 +28,7 @@ + #Exporter::export_ok_tags('all') ; + + ++ + sub smartRead + { + my $self = $_[0]; +@@ -59,12 +60,21 @@ + + my $get_size = $size - $offset ; + +- #if ( defined *$self->{InputLength} ) { +- # $get_size = min($get_size, *$self->{InputLengthRemaining}); +- #} +- +- if (defined *$self->{FH}) +- { *$self->{FH}->read($$out, $get_size, $offset) } ++ if (defined *$self->{FH}) { ++ if ($offset) { ++ # Not using this ++ # ++ # *$self->{FH}->read($$out, $get_size, $offset); ++ # ++ # because the filehandle may not support the offset parameter ++ # An example is Net::FTP ++ my $tmp = ''; ++ *$self->{FH}->read($tmp, $get_size) > 0 && ++ (substr($$out, $offset) = $tmp); ++ } ++ else ++ { *$self->{FH}->read($$out, $get_size) } ++ } + elsif (defined *$self->{InputEvent}) { + my $got = 1 ; + while (length $$out < $size) { +@@ -174,7 +184,24 @@ + return 0 if length *$self->{Prime} || *$self->{PushMode}; + + if (defined *$self->{FH}) +- { *$self->{FH}->eof() } ++ { ++ # Could use ++ # ++ # *$self->{FH}->eof() ++ # ++ # here, but this can cause trouble if ++ # the filehandle is itself a tied handle, but it uses sysread. ++ # Then we get into mixing buffered & non-buffered IO, which will cause trouble ++ ++ my $info = $self->getErrInfo(); ++ ++ my $buffer = ''; ++ my $status = $self->smartRead(\$buffer, 1); ++ $self->pushBack($buffer) if length $buffer; ++ $self->setErrInfo($info); ++ ++ return $status == 0 ; ++ } + elsif (defined *$self->{InputEvent}) + { *$self->{EventEof} } + else +@@ -189,6 +216,22 @@ + ${ *$self->{Error} } = '' ; + } + ++sub getErrInfo ++{ ++ my $self = shift ; ++ ++ return [ *$self->{ErrorNo}, ${ *$self->{Error} } ] ; ++} ++ ++sub setErrInfo ++{ ++ my $self = shift ; ++ my $ref = shift; ++ ++ *$self->{ErrorNo} = $ref->[0] ; ++ ${ *$self->{Error} } = $ref->[1] ; ++} ++ + sub saveStatus + { + my $self = shift ; +@@ -425,7 +468,7 @@ + return $obj + } + +- my $status = $obj->mkUncomp($class, $got); ++ my $status = $obj->mkUncomp($got); + + return undef + unless defined $status; +@@ -490,7 +533,7 @@ + my $output = shift ; + + +- my $x = new Validator($class, *$obj->{Error}, $name, $input, $output) ++ my $x = new IO::Compress::Base::Validator($class, *$obj->{Error}, $name, $input, $output) + or return undef ; + + push @_, $output if $haveOut && $x->{Hash}; +@@ -813,7 +856,7 @@ + $self->postBlockChk($buffer, $before_len) == STATUS_OK + or return G_ERR; + +- $buf_len = length($$buffer) - $before_len; ++ $buf_len = defined $$buffer ? length($$buffer) - $before_len : 0; + + *$self->{CompSize}->add($beforeC_len - length $temp_buf) ; + +@@ -929,7 +972,7 @@ + my $magic = $self->ckMagic(); + #*$self->{EndStream} = 0 ; + +- if ( ! $magic) { ++ if ( ! defined $magic) { + if (! *$self->{Transparent} ) + { + *$self->{EndStream} = 1 ; +@@ -1247,6 +1290,8 @@ + sub DESTROY + { + my $self = shift ; ++ local ($., $@, $!, $^E, $?); ++ + $self->close() ; + } + +@@ -1372,23 +1417,17 @@ + + =head1 NAME + +- + IO::Uncompress::Base - Base Class for IO::Uncompress modules + +- + =head1 SYNOPSIS + + use IO::Uncompress::Base ; + + =head1 DESCRIPTION + +- + This module is not intended for direct use in application code. Its sole + purpose if to to be sub-classed by IO::Unompress modules. + +- +- +- + =head1 SEE ALSO + + L, L, L, L, L, L, L, L, L, L, L, L, L, L, L +@@ -1399,23 +1438,17 @@ + L, + L + +- +- +- +- + =head1 AUTHOR + + This module was written by Paul Marquess, F. + +- +- + =head1 MODIFICATION HISTORY + + See the Changes file. + + =head1 COPYRIGHT AND LICENSE + +-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. +diff -urN perl-5.10.0.orig/ext/IO_Compress_Base/t/01misc.t perl-5.10.0/ext/IO_Compress_Base/t/01misc.t +--- perl-5.10.0.orig/ext/IO_Compress_Base/t/01misc.t 2007-12-18 11:47:07.000000000 +0100 ++++ perl-5.10.0/ext/IO_Compress_Base/t/01misc.t 2009-12-01 11:17:37.000000000 +0100 +@@ -19,7 +19,7 @@ + $extra = 1 + if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 }; + +- plan tests => 78 + $extra ; ++ plan tests => 88 + $extra ; + + use_ok('Scalar::Util'); + use_ok('IO::Compress::Base::Common'); +@@ -95,13 +95,11 @@ + my $got = ParseParameters(1, {'Fred' => [1, 1, 0x1000000, 0]}, Fred => 'abc') ; + is $got->value('Fred'), "abc", "other" ; + +- $got = ParseParameters(1, {'Fred' => [0, 1, Parse_any, undef]}, Fred => +-undef) ; ++ $got = ParseParameters(1, {'Fred' => [0, 1, Parse_any, undef]}, Fred => undef) ; + ok $got->parsed('Fred'), "undef" ; + ok ! defined $got->value('Fred'), "undef" ; + +- $got = ParseParameters(1, {'Fred' => [0, 1, Parse_string, undef]}, Fred => +-undef) ; ++ $got = ParseParameters(1, {'Fred' => [0, 1, Parse_string, undef]}, Fred => undef) ; + ok $got->parsed('Fred'), "undef" ; + is $got->value('Fred'), "", "empty string" ; + +@@ -117,11 +115,41 @@ + + ok $got->parsed('Fred'), "parsed" ; + $xx_ref = $got->value('Fred'); ++ + $$xx_ref = 666 ; + is $xx, 666; + ++ { ++ my $got1 = ParseParameters(1, {'Fred' => [1, 1, Parse_writable_scalar, undef]}, $got) ; ++ is $got1, $got, "Same object"; ++ ++ ok $got1->parsed('Fred'), "parsed" ; ++ $xx_ref = $got1->value('Fred'); ++ ++ $$xx_ref = 777 ; ++ is $xx, 777; ++ } ++ ++ my $got2 = ParseParameters(1, {'Fred' => [1, 1, Parse_writable_scalar, undef]}, '__xxx__' => $got) ; ++ isnt $got2, $got, "not the Same object"; ++ ++ ok $got2->parsed('Fred'), "parsed" ; ++ $xx_ref = $got2->value('Fred'); ++ $$xx_ref = 888 ; ++ is $xx, 888; ++ ++ my $other; ++ my $got3 = ParseParameters(1, {'Fred' => [1, 1, Parse_writable_scalar, undef]}, '__xxx__' => $got, Fred => \$other) ; ++ isnt $got3, $got, "not the Same object"; ++ ++ ok $got3->parsed('Fred'), "parsed" ; ++ $xx_ref = $got3->value('Fred'); ++ $$xx_ref = 999 ; ++ is $other, 999; ++ is $xx, 888; + } + ++ + My::testParseParameters(); + + +diff -urN perl-5.10.0.orig/t/lib/compress/CompTestUtils.pm perl-5.10.0/t/lib/compress/CompTestUtils.pm +--- perl-5.10.0.orig/t/lib/compress/CompTestUtils.pm 2007-12-18 11:47:08.000000000 +0100 ++++ perl-5.10.0/t/lib/compress/CompTestUtils.pm 2009-12-01 11:18:49.000000000 +0100 +@@ -203,6 +203,14 @@ + return readFile($filename) eq unpack("u", $uue) ; + } + ++sub isRawFormat ++{ ++ my $class = shift; ++ my %raw = map { $_ => 1 } qw( RawDeflate ); ++ ++ return defined $raw{$class}; ++} ++ + sub uncompressBuffer + { + my $compWith = shift ; +@@ -222,6 +230,8 @@ + 'IO::Compress::Lzop::lzop' => 'IO::Uncompress::UnLzop', + 'IO::Compress::Lzf' => 'IO::Uncompress::UnLzf' , + 'IO::Compress::Lzf::lzf' => 'IO::Uncompress::UnLzf', ++ 'IO::Compress::PPMd' => 'IO::Uncompress::UnPPMd' , ++ 'IO::Compress::PPMd::ppmd' => 'IO::Uncompress::UnPPMd', + 'IO::Compress::DummyComp' => 'IO::Uncompress::DummyUncomp', + 'IO::Compress::DummyComp::dummycomp' => 'IO::Uncompress::DummyUncomp', + ); +@@ -265,6 +275,10 @@ + 'IO::Compress::Lzf::lzf' => \$IO::Compress::Lzf::LzfError, + 'IO::Uncompress::UnLzf' => \$IO::Uncompress::UnLzf::UnLzfError, + 'IO::Uncompress::UnLzf::unlzf' => \$IO::Uncompress::UnLzf::UnLzfError, ++ 'IO::Compress::PPMd' => \$IO::Compress::PPMd::PPMdError, ++ 'IO::Compress::PPMd::ppmd' => \$IO::Compress::PPMd::PPMdError, ++ 'IO::Uncompress::UnPPMd' => \$IO::Uncompress::UnPPMd::UnPPMdError, ++ 'IO::Uncompress::UnPPMd::unppmd' => \$IO::Uncompress::UnPPMd::UnPPMdError, + + 'IO::Compress::DummyComp' => \$IO::Compress::DummyComp::DummyCompError, + 'IO::Compress::DummyComp::dummycomp'=> \$IO::Compress::DummyComp::DummyCompError, +@@ -293,6 +307,8 @@ + 'IO::Uncompress::UnLzop' => 'IO::Uncompress::UnLzop::unlzop', + 'IO::Compress::Lzf' => 'IO::Compress::Lzf::lzf', + 'IO::Uncompress::UnLzf' => 'IO::Uncompress::UnLzf::unlzf', ++ 'IO::Compress::PPMd' => 'IO::Compress::PPMd::ppmd', ++ 'IO::Uncompress::UnPPMd' => 'IO::Uncompress::UnPPMd::unppmd', + 'IO::Compress::DummyComp' => 'IO::Compress::DummyComp::dummyuncomp', + 'IO::Uncompress::DummyUncomp' => 'IO::Uncompress::DummyUncomp::dummyuncomp', + ); +@@ -319,6 +335,8 @@ + 'IO::Compress::Lzop' => 'IO::Uncompress::UnLzop', + 'IO::Compress::Lzf::lzf' => 'IO::Uncompress::UnLzf::unlzf', + 'IO::Compress::Lzf' => 'IO::Uncompress::UnLzf', ++ 'IO::Compress::PPMd::ppmd' => 'IO::Uncompress::UnPPMd::unppmd', ++ 'IO::Compress::PPMd' => 'IO::Uncompress::UnPPMd', + 'IO::Compress::DummyComp::dummycomp' => 'IO::Uncompress::DummyUncomp::dummyuncomp', + 'IO::Compress::DummyComp' => 'IO::Uncompress::DummyUncomp', + ); +@@ -372,6 +390,8 @@ + 'IO::Uncompress::UnLzop::unlzop' => 'IO::Compress::Lzop', + 'IO::Uncompress::UnLzp' => 'IO::Compress::Lzf', + 'IO::Uncompress::UnLzf::unlzf' => 'IO::Compress::Lzf', ++ 'IO::Uncompress::UnPPMd' => 'IO::Compress::PPMd', ++ 'IO::Uncompress::UnPPMd::unppmd' => 'IO::Compress::PPMd', + 'IO::Uncompress::AnyInflate' => 'IO::Compress::Gzip', + 'IO::Uncompress::AnyInflate::anyinflate' => 'IO::Compress::Gzip', + 'IO::Uncompress::AnyUncompress' => 'IO::Compress::Gzip', +diff -urN perl-5.10.0.orig/t/lib/compress/destroy.pl perl-5.10.0/t/lib/compress/destroy.pl +--- perl-5.10.0.orig/t/lib/compress/destroy.pl 2007-12-18 11:47:08.000000000 +0100 ++++ perl-5.10.0/t/lib/compress/destroy.pl 2009-12-01 11:18:49.000000000 +0100 +@@ -17,7 +17,7 @@ + $extra = 1 + if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 }; + +- plan tests => 7 + $extra ; ++ plan tests => 15 + $extra ; + + use_ok('IO::File') ; + } +@@ -73,6 +73,43 @@ + + ok anyUncompress($name) eq $hello ; + } ++ ++ { ++ title "Testing DESTROY doesn't clobber \$! etc "; ++ ++ my $lex = new LexFile my $name ; ++ ++ my $out; ++ my $result; ++ ++ { ++ ok my $z = new $CompressClass($name); ++ $z->write("abc") ; ++ $! = 22 ; ++ ++ cmp_ok $!, '==', 22, ' $! is 22'; ++ } ++ ++ cmp_ok $!, '==', 22, " \$! has not been changed by $CompressClass destructor"; ++ ++ ++ { ++ my $uncomp; ++ ok my $x = new $UncompressClass($name, -Append => 1) ; ++ ++ my $len ; ++ 1 while ($len = $x->read($result)) > 0 ; ++ ++ $! = 22 ; ++ ++ cmp_ok $!, '==', 22, ' $! is 22'; ++ } ++ ++ cmp_ok $!, '==', 22, " \$! has not been changed by $UncompressClass destructor"; ++ ++ is $result, "abc", " Got uncompressed content ok"; ++ ++ } + } + + 1; +diff -urN perl-5.10.0.orig/t/lib/compress/generic.pl perl-5.10.0/t/lib/compress/generic.pl +--- perl-5.10.0.orig/t/lib/compress/generic.pl 2007-12-18 11:47:08.000000000 +0100 ++++ perl-5.10.0/t/lib/compress/generic.pl 2009-12-01 11:18:49.000000000 +0100 +@@ -47,6 +47,7 @@ + my $Error = getErrorRef($CompressClass); + my $UnError = getErrorRef($UncompressClass); + ++ if(1) + { + + title "Testing $CompressClass Errors"; +@@ -81,7 +82,7 @@ + like $@, mkEvalErr("^${CompressClass}::write: offset outside string"); + + eval ' $gz->syswrite("abc", 1, -4)' ; +- like $@, mkEvalErr("^${CompressClass}::write: offset outside string"); ++ like $@, mkEvalErr("^${CompressClass}::write: offset outside string"), "write outside string"; + } + + +@@ -118,6 +119,7 @@ + + } + ++ + { + title "Testing $CompressClass and $UncompressClass"; + +@@ -161,7 +163,6 @@ + + + my $lex = new LexFile my $name ; +- #my $name = "/tmp/try.lzf"; + + my $hello = <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" ; + diff --git a/perl-update-IO-Compress-Zlib.patch b/perl-update-IO-Compress-Zlib.patch new file mode 100644 index 0000000..71a06d0 --- /dev/null +++ b/perl-update-IO-Compress-Zlib.patch @@ -0,0 +1,5232 @@ +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" ; + + 2. If you are having problems building IO-Compress-Zlib, send me a + complete log of what happened. Start by unpacking the IO-Compress-Zlib +@@ -137,5 +104,4 @@ + make + make test TEST_VERBOSE=1 + +- + Paul Marquess +diff -urN perl-5.10.0.orig/ext/IO_Compress_Zlib/lib/IO/Compress/Adapter/Deflate.pm perl-5.10.0/ext/IO_Compress_Zlib/lib/IO/Compress/Adapter/Deflate.pm +--- perl-5.10.0.orig/ext/IO_Compress_Zlib/lib/IO/Compress/Adapter/Deflate.pm 2007-12-18 11:47:07.000000000 +0100 ++++ perl-5.10.0/ext/IO_Compress_Zlib/lib/IO/Compress/Adapter/Deflate.pm 2009-12-01 12:08:12.000000000 +0100 +@@ -4,12 +4,12 @@ + use warnings; + use bytes; + +-use IO::Compress::Base::Common 2.008 qw(:Status); ++use IO::Compress::Base::Common 2.015 qw(:Status); + +-use Compress::Raw::Zlib 2.008 qw(Z_OK Z_FINISH MAX_WBITS) ; ++use Compress::Raw::Zlib 2.015 qw(Z_OK Z_FINISH MAX_WBITS) ; + our ($VERSION); + +-$VERSION = '2.008'; ++$VERSION = '2.015'; + + sub mkCompObject + { +diff -urN perl-5.10.0.orig/ext/IO_Compress_Zlib/lib/IO/Compress/Adapter/Identity.pm perl-5.10.0/ext/IO_Compress_Zlib/lib/IO/Compress/Adapter/Identity.pm +--- perl-5.10.0.orig/ext/IO_Compress_Zlib/lib/IO/Compress/Adapter/Identity.pm 2007-12-18 11:47:07.000000000 +0100 ++++ perl-5.10.0/ext/IO_Compress_Zlib/lib/IO/Compress/Adapter/Identity.pm 2009-12-01 12:08:12.000000000 +0100 +@@ -4,10 +4,10 @@ + use warnings; + use bytes; + +-use IO::Compress::Base::Common 2.008 qw(:Status); ++use IO::Compress::Base::Common 2.015 qw(:Status); + our ($VERSION); + +-$VERSION = '2.008'; ++$VERSION = '2.015'; + + sub mkCompObject + { +diff -urN perl-5.10.0.orig/ext/IO_Compress_Zlib/lib/IO/Compress/Deflate.pm perl-5.10.0/ext/IO_Compress_Zlib/lib/IO/Compress/Deflate.pm +--- perl-5.10.0.orig/ext/IO_Compress_Zlib/lib/IO/Compress/Deflate.pm 2007-12-18 11:47:07.000000000 +0100 ++++ perl-5.10.0/ext/IO_Compress_Zlib/lib/IO/Compress/Deflate.pm 2009-12-01 12:08:12.000000000 +0100 +@@ -6,16 +6,16 @@ + + require Exporter ; + +-use IO::Compress::RawDeflate 2.008 ; ++use IO::Compress::RawDeflate 2.015 ; + +-use Compress::Raw::Zlib 2.008 ; +-use IO::Compress::Zlib::Constants 2.008 ; +-use IO::Compress::Base::Common 2.008 qw(createSelfTiedObject); ++use Compress::Raw::Zlib 2.015 ; ++use IO::Compress::Zlib::Constants 2.015 ; ++use IO::Compress::Base::Common 2.015 qw(createSelfTiedObject); + + + our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $DeflateError); + +-$VERSION = '2.008'; ++$VERSION = '2.015'; + $DeflateError = ''; + + @ISA = qw(Exporter IO::Compress::RawDeflate); +@@ -166,8 +166,6 @@ + + =head1 NAME + +- +- + IO::Compress::Deflate - Write RFC 1950 files/buffers + + +@@ -176,7 +174,6 @@ + + use IO::Compress::Deflate qw(deflate $DeflateError) ; + +- + my $status = deflate $input => $output [,OPTS] + or die "deflate failed: $DeflateError\n"; + +@@ -218,24 +215,12 @@ + + =head1 DESCRIPTION + +- + This module provides a Perl interface that allows writing compressed + data to files or buffer as defined in RFC 1950. + +- +- +- +- +- +- +- +- +- +- + For reading RFC 1950 files/buffers, see the companion module + L. + +- + =head1 Functional Interface + + A top-level function, C, is provided to carry out +@@ -248,14 +233,10 @@ + deflate $input => $output [,OPTS] + or die "deflate failed: $DeflateError\n"; + +- +- + The functional interface needs Perl5.005 or better. + +- + =head2 deflate $input => $output [, OPTS] + +- + C expects at least two parameters, C<$input> and C<$output>. + + =head3 The C<$input> parameter +@@ -294,8 +275,6 @@ + The complete array will be walked to ensure that it only + contains valid filenames before any data is compressed. + +- +- + =item An Input FileGlob string + + If C<$input> is a string that is delimited by the characters "<" and ">" +@@ -306,13 +285,10 @@ + + See L for more details. + +- + =back + + If the C<$input> parameter is any other type, C will be returned. + +- +- + =head3 The C<$output> parameter + + The parameter C<$output> is used to control the destination of the +@@ -332,14 +308,11 @@ + will be written to it. + The string '-' can be used as an alias for standard output. + +- + =item A scalar reference + + If C<$output> is a scalar reference, the compressed data will be + stored in C<$$output>. + +- +- + =item An Array Reference + + If C<$output> is an array reference, the compressed data will be +@@ -358,21 +331,12 @@ + + If the C<$output> parameter is any other type, C will be returned. + +- +- + =head2 Notes + +- +- + When C<$input> maps to multiple files/buffers and C<$output> is a single + file/buffer the input files/buffers will be stored + in C<$output> as a concatenated series of compressed data streams. + +- +- +- +- +- + =head2 Optional Parameters + + Unless specified below, the optional parameters for C, +@@ -392,27 +356,18 @@ + + This parameter defaults to 0. + +- + =item C<< BinModeIn => 0|1 >> + + When reading from a file or filehandle, set C before reading. + + Defaults to 0. + +- +- +- +- + =item C<< Append => 0|1 >> + + TODO + +- +- + =back + +- +- + =head2 Examples + + To read the contents of the file C and write the compressed +@@ -426,7 +381,6 @@ + deflate $input => "$input.1950" + or die "deflate failed: $DeflateError\n"; + +- + To read from an existing Perl filehandle, C<$input>, and write the + compressed data to a buffer, C<$buffer>. + +@@ -464,7 +418,6 @@ + or die "Error compressing '$input': $DeflateError\n"; + } + +- + =head1 OO Interface + + =head2 Constructor +@@ -504,7 +457,6 @@ + written to it. + The string '-' can be used as an alias for standard output. + +- + =item A scalar reference + + If C<$output> is a scalar reference, the compressed data will be stored +@@ -560,23 +512,15 @@ + + This parameter defaults to 0. + +- +- +- +- + =item C<< Merge => 0|1 >> + + This option is used to compress input data and append it to an existing + compressed data stream in C<$output>. The end result is a single compressed + data stream stored in C<$output>. + +- +- + It is a fatal error to attempt to use this option when C<$output> is not an + RFC 1950 data stream. + +- +- + There are a number of other limitations with the C option: + + =over 5 +@@ -593,11 +537,8 @@ + + =back + +- + This parameter defaults to 0. + +- +- + =item -Level + + Defines the compression level used by zlib. The value should either be +@@ -630,19 +571,10 @@ + + The default is Z_DEFAULT_STRATEGY. + +- +- +- +- +- + =item C<< Strict => 0|1 >> + +- +- + This is a placeholder option. + +- +- + =back + + =head2 Examples +@@ -704,14 +636,11 @@ + + Usage is + +- + $z->flush; + $z->flush($flush_type); + +- + Flushes any pending compressed data to the output file/buffer. + +- + This method takes an optional parameter, C<$flush_type>, that controls + how the flushing will be carried out. By default the C<$flush_type> + used is C. Other valid values for C<$flush_type> are +@@ -721,10 +650,8 @@ + can seriously degrade the level of compression achieved. See the C + documentation for details. + +- + Returns true on success. + +- + =head2 tell + + Usage is +@@ -741,28 +668,19 @@ + $z->eof(); + eof($z); + +- +- + Returns true if the C method has been called. + +- +- + =head2 seek + + $z->seek($position, $whence); + seek($z, $position, $whence); + +- +- +- + Provides a sub-set of the C functionality, with the restriction + that it is only legal to seek forward in the output file/buffer. + It is a fatal error to attempt to seek backward. + + Empty parts of the file/buffer will have NULL (0x00) bytes written to them. + +- +- + The C<$whence> parameter takes one the usual values, namely SEEK_SET, + SEEK_CUR or SEEK_END. + +@@ -804,33 +722,27 @@ + $z->input_line_number() + $z->input_line_number(EXPR) + +- + This method always returns C when compressing. + +- +- + =head2 fileno + + $z->fileno() + fileno($z) + +-If the C<$z> object is associated with a file or a filehandle, this method +-will return the underlying file descriptor. ++If the C<$z> object is associated with a file or a filehandle, C ++will return the underlying file descriptor. Once the C method is ++called C will return C. + +-If the C<$z> object is is associated with a buffer, this method will +-return undef. ++If the C<$z> object is is associated with a buffer, this method will return ++C. + + =head2 close + + $z->close() ; + close $z ; + +- +- + Flushes any pending compressed data and then closes the output file/buffer. + +- +- + For most versions of Perl this method will be automatically invoked if + the IO::Compress::Deflate object is destroyed (either explicitly or by the + variable with the reference to the object going out of scope). The +@@ -849,9 +761,6 @@ + object was created, and the object is associated with a file, the + underlying file will also be closed. + +- +- +- + =head2 newStream([OPTS]) + + Usage is +@@ -865,7 +774,6 @@ + + See the L section for more details. + +- + =head2 deflateParams + + Usage is +@@ -874,20 +782,15 @@ + + TODO + +- + =head1 Importing + +- + A number of symbolic constants are required by some methods in + C. None are imported by default. + +- +- + =over 5 + + =item :all + +- + Imports C, C<$DeflateError> and all symbolic + constants that can be used by C. Same as doing this + +@@ -897,10 +800,8 @@ + + Import all symbolic constants. Same as doing this + +- + use IO::Compress::Deflate qw(:flush :level :strategy) ; + +- + =item :flush + + These symbolic constants are used by the C method. +@@ -921,7 +822,6 @@ + Z_BEST_COMPRESSION + Z_DEFAULT_COMPRESSION + +- + =item :strategy + + These symbolic constants are used by the C option in the constructor. +@@ -937,21 +837,17 @@ + + =back + +-For +- + =head1 EXAMPLES + +-TODO +- +- +- +- +- +- ++=head2 Apache::GZip Revisited + ++See L + ++ + ++=head2 Working with Net::FTP + ++See L + + =head1 SEE ALSO + +@@ -963,7 +859,6 @@ + L, + L + +- + For RFC 1950, 1951 and 1952 see + F, + F and +@@ -977,24 +872,18 @@ + + The primary site for gzip is F. + +- +- +- + =head1 AUTHOR + + This module was written by Paul Marquess, F. + +- +- + =head1 MODIFICATION HISTORY + + See the Changes file. + + =head1 COPYRIGHT AND LICENSE + +-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. + +- +diff -urN perl-5.10.0.orig/ext/IO_Compress_Zlib/lib/IO/Compress/Gzip/Constants.pm perl-5.10.0/ext/IO_Compress_Zlib/lib/IO/Compress/Gzip/Constants.pm +--- perl-5.10.0.orig/ext/IO_Compress_Zlib/lib/IO/Compress/Gzip/Constants.pm 2007-12-18 11:47:07.000000000 +0100 ++++ perl-5.10.0/ext/IO_Compress_Zlib/lib/IO/Compress/Gzip/Constants.pm 2009-12-01 12:08:12.000000000 +0100 +@@ -9,7 +9,7 @@ + our ($VERSION, @ISA, @EXPORT, %GZIP_OS_Names); + our ($GZIP_FNAME_INVALID_CHAR_RE, $GZIP_FCOMMENT_INVALID_CHAR_RE); + +-$VERSION = '2.008'; ++$VERSION = '2.015'; + + @ISA = qw(Exporter); + +diff -urN perl-5.10.0.orig/ext/IO_Compress_Zlib/lib/IO/Compress/Gzip.pm perl-5.10.0/ext/IO_Compress_Zlib/lib/IO/Compress/Gzip.pm +--- perl-5.10.0.orig/ext/IO_Compress_Zlib/lib/IO/Compress/Gzip.pm 2007-12-18 11:47:07.000000000 +0100 ++++ perl-5.10.0/ext/IO_Compress_Zlib/lib/IO/Compress/Gzip.pm 2009-12-01 12:08:12.000000000 +0100 +@@ -8,12 +8,12 @@ + use bytes; + + +-use IO::Compress::RawDeflate 2.008 ; ++use IO::Compress::RawDeflate 2.015 ; + +-use Compress::Raw::Zlib 2.008 ; +-use IO::Compress::Base::Common 2.008 qw(:Status :Parse createSelfTiedObject); +-use IO::Compress::Gzip::Constants 2.008 ; +-use IO::Compress::Zlib::Extra 2.008 ; ++use Compress::Raw::Zlib 2.015 ; ++use IO::Compress::Base::Common 2.015 qw(:Status :Parse createSelfTiedObject); ++use IO::Compress::Gzip::Constants 2.015 ; ++use IO::Compress::Zlib::Extra 2.015 ; + + BEGIN + { +@@ -27,7 +27,7 @@ + + our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $GzipError); + +-$VERSION = '2.008'; ++$VERSION = '2.015'; + $GzipError = '' ; + + @ISA = qw(Exporter IO::Compress::RawDeflate); +@@ -274,8 +274,6 @@ + + =head1 NAME + +- +- + IO::Compress::Gzip - Write RFC 1952 files/buffers + + +@@ -284,7 +282,6 @@ + + use IO::Compress::Gzip qw(gzip $GzipError) ; + +- + my $status = gzip $input => $output [,OPTS] + or die "gzip failed: $GzipError\n"; + +@@ -326,27 +323,15 @@ + + =head1 DESCRIPTION + +- + This module provides a Perl interface that allows writing compressed + data to files or buffer as defined in RFC 1952. + +- +- +- +- + All the gzip headers defined in RFC 1952 can be created using + this module. + +- +- +- +- +- +- + For reading RFC 1952 files/buffers, see the companion module + L. + +- + =head1 Functional Interface + + A top-level function, C, is provided to carry out +@@ -359,14 +344,10 @@ + gzip $input => $output [,OPTS] + or die "gzip failed: $GzipError\n"; + +- +- + The functional interface needs Perl5.005 or better. + +- + =head2 gzip $input => $output [, OPTS] + +- + C expects at least two parameters, C<$input> and C<$output>. + + =head3 The C<$input> parameter +@@ -405,8 +386,6 @@ + The complete array will be walked to ensure that it only + contains valid filenames before any data is compressed. + +- +- + =item An Input FileGlob string + + If C<$input> is a string that is delimited by the characters "<" and ">" +@@ -417,12 +396,10 @@ + + See L for more details. + +- + =back + + If the C<$input> parameter is any other type, C will be returned. + +- + In addition, if C<$input> is a simple filename, the default values for + the C and C