From: Paul Marquess Date: Tue, 15 Jul 2008 23:25:49 +0000 (+0100) Subject: Update Compression modules to version 2.012 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e11a3f9e253ea690bf3301f3569bb25c76cb5183;p=p5sagit%2Fp5-mst-13.2.git Update Compression modules to version 2.012 From: "Paul Marquess" Message-ID: <018801c8e6c9$c0a76530$41f62f90$@Marquess@ntlworld.com> p4raw-id: //depot/perl@34145 --- diff --git a/ext/Compress/Raw/Zlib/Changes b/ext/Compress/Raw/Zlib/Changes index 8a6ffc9..b7cc19d 100644 --- a/ext/Compress/Raw/Zlib/Changes +++ b/ext/Compress/Raw/Zlib/Changes @@ -1,6 +1,14 @@ CHANGES ------- + 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. diff --git a/ext/Compress/Raw/Zlib/README b/ext/Compress/Raw/Zlib/README index f6f2896..42d2d6b 100644 --- a/ext/Compress/Raw/Zlib/README +++ b/ext/Compress/Raw/Zlib/README @@ -1,9 +1,9 @@ Compress-Raw-Zlib - Version 2.011 + Version 2.012 - 17th May 2008 + 15th July 2008 Copyright (c) 2005-2008 Paul Marquess. All rights reserved. This program is free software; you can redistribute it @@ -326,7 +326,7 @@ To help me help you, I need all of the following information: If you haven't installed Compress-Raw-Zlib then search Compress::Raw::Zlib.pm for a line like this: - $VERSION = "2.011" ; + $VERSION = "2.012" ; c. The version of zlib you have used. If you have successfully installed Compress-Raw-Zlib, this one-liner diff --git a/ext/Compress/Raw/Zlib/Zlib.xs b/ext/Compress/Raw/Zlib/Zlib.xs index d4ded8c..cd366f1 100644 --- a/ext/Compress/Raw/Zlib/Zlib.xs +++ b/ext/Compress/Raw/Zlib/Zlib.xs @@ -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 @@ -808,6 +812,19 @@ _inflateInit(flags, windowBits, bufsize, dictionary) 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) ; } @@ -1297,8 +1314,9 @@ inflate (s, buf, output, eof=FALSE) } s->bytesInflated = 0; - while (1) { + RETVAL = Z_OK; + 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) ; @@ -1331,8 +1349,6 @@ inflate (s, buf, output, eof=FALSE) SvCUR(s->dictionary)); } - if (RETVAL != Z_OK) - break; } #ifdef NEED_DUMMY_BYTE_AT_END if (eof && RETVAL == Z_OK) { diff --git a/ext/Compress/Raw/Zlib/lib/Compress/Raw/Zlib.pm b/ext/Compress/Raw/Zlib/lib/Compress/Raw/Zlib.pm index 77cb86e..5f15031 100644 --- a/ext/Compress/Raw/Zlib/lib/Compress/Raw/Zlib.pm +++ b/ext/Compress/Raw/Zlib/lib/Compress/Raw/Zlib.pm @@ -13,7 +13,7 @@ use warnings ; use bytes ; our ($VERSION, $XS_VERSION, @ISA, @EXPORT, $AUTOLOAD); -$VERSION = '2.011'; +$VERSION = '2.012'; $XS_VERSION = $VERSION; $VERSION = eval $VERSION; @@ -62,8 +62,13 @@ $VERSION = eval $VERSION; 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); @@ -361,10 +366,14 @@ sub Compress::Raw::Zlib::Deflate::new $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'), @@ -398,7 +407,11 @@ sub Compress::Raw::Zlib::Inflate::new $flags |= FLAG_ADLER if $got->value('ADLER32') ; $flags |= FLAG_CONSUME_INPUT if $got->value('ConsumeInput') ; - _inflateInit($flags, $got->value('WindowBits'), $got->value('Bufsize'), + my $windowBits = $got->value('WindowBits'); + $windowBits += MAX_WBITS() + if ($windowBits & MAX_WBITS()) == 0 ; + + _inflateInit($flags, $windowBits, $got->value('Bufsize'), $got->value('Dictionary')) ; } @@ -607,7 +620,7 @@ Defines the compression level. Valid values are 0 through 9, C, C, C, and C. -The default is Z_DEFAULT_COMPRESSION. +The default is C. =item B<-Method> @@ -616,10 +629,18 @@ the default) is Z_DEFLATED. =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> @@ -883,14 +904,20 @@ Here is a list of the valid options: =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> diff --git a/ext/Compress/Raw/Zlib/private/MakeUtil.pm b/ext/Compress/Raw/Zlib/private/MakeUtil.pm index 974b761..4c706e0 100644 --- a/ext/Compress/Raw/Zlib/private/MakeUtil.pm +++ b/ext/Compress/Raw/Zlib/private/MakeUtil.pm @@ -49,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: diff --git a/ext/Compress/Raw/Zlib/t/02zlib.t b/ext/Compress/Raw/Zlib/t/02zlib.t index 4550f05..889566a 100644 --- a/ext/Compress/Raw/Zlib/t/02zlib.t +++ b/ext/Compress/Raw/Zlib/t/02zlib.t @@ -24,13 +24,13 @@ BEGIN my $count = 0 ; if ($] < 5.005) { - $count = 189 ; + $count = 229 ; } elsif ($] >= 5.006) { - $count = 243 ; + $count = 283 ; } else { - $count = 201 ; + $count = 241 ; } plan tests => $count + $extra; @@ -726,6 +726,142 @@ if ($] >= 5.005) 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 --git a/ext/Compress/Zlib/Changes b/ext/Compress/Zlib/Changes index 60edccb..74874e7 100644 --- a/ext/Compress/Zlib/Changes +++ b/ext/Compress/Zlib/Changes @@ -1,6 +1,10 @@ CHANGES ------- + 2.012 15 July 2008 + + * No Changes + 2.011 17 May 2008 * No Changes diff --git a/ext/Compress/Zlib/Makefile.PL b/ext/Compress/Zlib/Makefile.PL index e79a132..6f4a8bb 100755 --- a/ext/Compress/Zlib/Makefile.PL +++ b/ext/Compress/Zlib/Makefile.PL @@ -3,7 +3,7 @@ use strict ; require 5.004 ; -$::VERSION = '2.011' ; +$::VERSION = '2.012' ; use private::MakeUtil; use ExtUtils::MakeMaker 5.16 ; diff --git a/ext/Compress/Zlib/README b/ext/Compress/Zlib/README index 0b550b5..77264db 100644 --- a/ext/Compress/Zlib/README +++ b/ext/Compress/Zlib/README @@ -1,9 +1,9 @@ Compress-Zlib - Version 2.011 + Version 2.012 - 17th May 2008 + 15th July 2008 Copyright (c) 1995-2008 Paul Marquess. All rights reserved. This program is free software; you can redistribute it @@ -106,7 +106,7 @@ To help me help you, I need all of the following information: If you haven't installed Compress-Zlib then search Compress::Zlib.pm for a line like this: - $VERSION = "2.011" ; + $VERSION = "2.012" ; 2. If you are having problems building Compress-Zlib, send me a complete log of what happened. Start by unpacking the Compress-Zlib diff --git a/ext/Compress/Zlib/lib/Compress/Zlib.pm b/ext/Compress/Zlib/lib/Compress/Zlib.pm index d662afc..47b2557 100644 --- a/ext/Compress/Zlib/lib/Compress/Zlib.pm +++ b/ext/Compress/Zlib/lib/Compress/Zlib.pm @@ -8,17 +8,17 @@ use Carp ; use IO::Handle ; use Scalar::Util qw(dualvar); -use IO::Compress::Base::Common 2.011 ; -use Compress::Raw::Zlib 2.011 ; -use IO::Compress::Gzip 2.011 ; -use IO::Uncompress::Gunzip 2.011 ; +use IO::Compress::Base::Common 2.012 ; +use Compress::Raw::Zlib 2.012 ; +use IO::Compress::Gzip 2.012 ; +use IO::Uncompress::Gunzip 2.012 ; use strict ; use warnings ; use bytes ; our ($VERSION, $XS_VERSION, @ISA, @EXPORT, $AUTOLOAD); -$VERSION = '2.011'; +$VERSION = '2.012'; $XS_VERSION = $VERSION; $VERSION = eval $VERSION; @@ -452,7 +452,7 @@ sub inflate package Compress::Zlib ; -use IO::Compress::Gzip::Constants 2.011 ; +use IO::Compress::Gzip::Constants 2.012 ; sub memGzip($) { diff --git a/ext/Compress/Zlib/private/MakeUtil.pm b/ext/Compress/Zlib/private/MakeUtil.pm index 974b761..4c706e0 100644 --- a/ext/Compress/Zlib/private/MakeUtil.pm +++ b/ext/Compress/Zlib/private/MakeUtil.pm @@ -49,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: diff --git a/ext/IO_Compress_Base/Changes b/ext/IO_Compress_Base/Changes index bab7a7e..3330827 100644 --- a/ext/IO_Compress_Base/Changes +++ b/ext/IO_Compress_Base/Changes @@ -1,6 +1,17 @@ CHANGES ------- + + 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 diff --git a/ext/IO_Compress_Base/README b/ext/IO_Compress_Base/README index f9d011b..823165c 100644 --- a/ext/IO_Compress_Base/README +++ b/ext/IO_Compress_Base/README @@ -1,9 +1,9 @@ IO-Compress-Base - Version 2.011 + Version 2.012 - 17th May 2008 + 15th July 2008 Copyright (c) 2005-2008 Paul Marquess. All rights reserved. This program is free software; you can redistribute it @@ -76,7 +76,7 @@ To help me help you, I need all of the following information: If you haven't installed IO-Compress-Base then search IO::Compress::Base.pm for a line like this: - $VERSION = "2.011" ; + $VERSION = "2.012" ; 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 diff --git a/ext/IO_Compress_Base/lib/IO/Compress/Base.pm b/ext/IO_Compress_Base/lib/IO/Compress/Base.pm index 9f05ed8..384ca05 100644 --- a/ext/IO_Compress_Base/lib/IO/Compress/Base.pm +++ b/ext/IO_Compress_Base/lib/IO/Compress/Base.pm @@ -6,7 +6,7 @@ require 5.004 ; use strict ; use warnings; -use IO::Compress::Base::Common 2.011 ; +use IO::Compress::Base::Common 2.012 ; use IO::File ; use Scalar::Util qw(blessed readonly); @@ -20,7 +20,7 @@ use bytes; our (@ISA, $VERSION); @ISA = qw(Exporter IO::File); -$VERSION = '2.011'; +$VERSION = '2.012'; #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. @@ -547,6 +547,8 @@ sub UNTIE sub DESTROY { my $self = shift ; + local ($., $@, $!, $^E, $?); + $self->close() ; # TODO - memory leak with 5.8.0 - this isn't called until @@ -975,4 +977,3 @@ 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 --git a/ext/IO_Compress_Base/lib/IO/Compress/Base/Common.pm b/ext/IO_Compress_Base/lib/IO/Compress/Base/Common.pm index a5b0975..26750f7 100644 --- a/ext/IO_Compress_Base/lib/IO/Compress/Base/Common.pm +++ b/ext/IO_Compress_Base/lib/IO/Compress/Base/Common.pm @@ -11,7 +11,7 @@ use File::GlobMapper; require Exporter; our ($VERSION, @ISA, @EXPORT, %EXPORT_TAGS, $HAS_ENCODE); @ISA = qw(Exporter); -$VERSION = '2.011'; +$VERSION = '2.012'; @EXPORT = qw( isaFilehandle isaFilename whatIsInput whatIsOutput isaFileGlobString cleanFileGlobString oneTarget diff --git a/ext/IO_Compress_Base/lib/IO/Uncompress/AnyUncompress.pm b/ext/IO_Compress_Base/lib/IO/Uncompress/AnyUncompress.pm index 8888577..e61acc6 100644 --- a/ext/IO_Compress_Base/lib/IO/Uncompress/AnyUncompress.pm +++ b/ext/IO_Compress_Base/lib/IO/Uncompress/AnyUncompress.pm @@ -4,16 +4,16 @@ use strict; use warnings; use bytes; -use IO::Compress::Base::Common 2.011 qw(createSelfTiedObject); +use IO::Compress::Base::Common 2.012 qw(createSelfTiedObject); -use IO::Uncompress::Base 2.011 ; +use IO::Uncompress::Base 2.012 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $AnyUncompressError); -$VERSION = '2.011'; +$VERSION = '2.012'; $AnyUncompressError = ''; @ISA = qw( Exporter IO::Uncompress::Base ); @@ -27,18 +27,18 @@ Exporter::export_ok_tags('all'); BEGIN { - eval ' use IO::Uncompress::Adapter::Inflate 2.011 ;'; - eval ' use IO::Uncompress::Adapter::Bunzip2 2.011 ;'; - eval ' use IO::Uncompress::Adapter::LZO 2.011 ;'; - eval ' use IO::Uncompress::Adapter::Lzf 2.011 ;'; - - eval ' use IO::Uncompress::Bunzip2 2.011 ;'; - eval ' use IO::Uncompress::UnLzop 2.011 ;'; - eval ' use IO::Uncompress::Gunzip 2.011 ;'; - eval ' use IO::Uncompress::Inflate 2.011 ;'; - eval ' use IO::Uncompress::RawInflate 2.011 ;'; - eval ' use IO::Uncompress::Unzip 2.011 ;'; - eval ' use IO::Uncompress::UnLzf 2.011 ;'; + eval ' use IO::Uncompress::Adapter::Inflate 2.012 ;'; + eval ' use IO::Uncompress::Adapter::Bunzip2 2.012 ;'; + eval ' use IO::Uncompress::Adapter::LZO 2.012 ;'; + eval ' use IO::Uncompress::Adapter::Lzf 2.012 ;'; + + eval ' use IO::Uncompress::Bunzip2 2.012 ;'; + eval ' use IO::Uncompress::UnLzop 2.012 ;'; + eval ' use IO::Uncompress::Gunzip 2.012 ;'; + eval ' use IO::Uncompress::Inflate 2.012 ;'; + eval ' use IO::Uncompress::RawInflate 2.012 ;'; + eval ' use IO::Uncompress::Unzip 2.012 ;'; + eval ' use IO::Uncompress::UnLzf 2.012 ;'; } sub new @@ -56,7 +56,7 @@ sub anyuncompress sub getExtraParams { - use IO::Compress::Base::Common 2.011 qw(:Parse); + use IO::Compress::Base::Common 2.012 qw(:Parse); return ( 'RawInflate' => [1, 1, Parse_boolean, 0] ) ; } diff --git a/ext/IO_Compress_Base/lib/IO/Uncompress/Base.pm b/ext/IO_Compress_Base/lib/IO/Uncompress/Base.pm index 4493042..bee5698 100644 --- a/ext/IO_Compress_Base/lib/IO/Uncompress/Base.pm +++ b/ext/IO_Compress_Base/lib/IO/Uncompress/Base.pm @@ -9,12 +9,12 @@ our (@ISA, $VERSION, @EXPORT_OK, %EXPORT_TAGS); @ISA = qw(Exporter IO::File); -$VERSION = '2.011'; +$VERSION = '2.012'; use constant G_EOF => 0 ; use constant G_ERR => -1 ; -use IO::Compress::Base::Common 2.011 ; +use IO::Compress::Base::Common 2.012 ; #use Parse::Parameters ; use IO::File ; @@ -856,7 +856,7 @@ sub _raw_read $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) ; @@ -1290,6 +1290,8 @@ sub close sub DESTROY { my $self = shift ; + local ($., $@, $!, $^E, $?); + $self->close() ; } @@ -1451,4 +1453,3 @@ 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 --git a/ext/IO_Compress_Base/private/MakeUtil.pm b/ext/IO_Compress_Base/private/MakeUtil.pm index 974b761..4c706e0 100644 --- a/ext/IO_Compress_Base/private/MakeUtil.pm +++ b/ext/IO_Compress_Base/private/MakeUtil.pm @@ -49,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: diff --git a/ext/IO_Compress_Zlib/Changes b/ext/IO_Compress_Zlib/Changes index 45cd027..0e6ff5c 100644 --- a/ext/IO_Compress_Zlib/Changes +++ b/ext/IO_Compress_Zlib/Changes @@ -1,6 +1,10 @@ CHANGES ------- + 2.012 15 July 2008 + + * No Changes + 2.011 17 May 2008 * IO::Uncompress::Unzip diff --git a/ext/IO_Compress_Zlib/Makefile.PL b/ext/IO_Compress_Zlib/Makefile.PL index deb323e..026c7b8 100644 --- a/ext/IO_Compress_Zlib/Makefile.PL +++ b/ext/IO_Compress_Zlib/Makefile.PL @@ -3,7 +3,7 @@ use strict ; require 5.004 ; -$::VERSION = '2.011' ; +$::VERSION = '2.012' ; use private::MakeUtil; use ExtUtils::MakeMaker 5.16 ; diff --git a/ext/IO_Compress_Zlib/README b/ext/IO_Compress_Zlib/README index 176bcff..b962502 100644 --- a/ext/IO_Compress_Zlib/README +++ b/ext/IO_Compress_Zlib/README @@ -1,9 +1,9 @@ IO-Compress-Zlib - Version 2.011 + Version 2.012 - 17th May 2008 + 15th July 2008 Copyright (c) 2005-2008 Paul Marquess. All rights reserved. This program is free software; you can redistribute it @@ -93,7 +93,7 @@ To help me help you, I need all of the following information: If you haven't installed IO-Compress-Zlib then search IO::Compress::Gzip.pm for a line like this: - $VERSION = "2.011" ; + $VERSION = "2.012" ; 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 diff --git a/ext/IO_Compress_Zlib/lib/IO/Compress/Adapter/Deflate.pm b/ext/IO_Compress_Zlib/lib/IO/Compress/Adapter/Deflate.pm index d8f5a5f..fa9e073 100644 --- a/ext/IO_Compress_Zlib/lib/IO/Compress/Adapter/Deflate.pm +++ b/ext/IO_Compress_Zlib/lib/IO/Compress/Adapter/Deflate.pm @@ -4,12 +4,12 @@ use strict; use warnings; use bytes; -use IO::Compress::Base::Common 2.011 qw(:Status); +use IO::Compress::Base::Common 2.012 qw(:Status); -use Compress::Raw::Zlib 2.011 qw(Z_OK Z_FINISH MAX_WBITS) ; +use Compress::Raw::Zlib 2.012 qw(Z_OK Z_FINISH MAX_WBITS) ; our ($VERSION); -$VERSION = '2.011'; +$VERSION = '2.012'; sub mkCompObject { diff --git a/ext/IO_Compress_Zlib/lib/IO/Compress/Adapter/Identity.pm b/ext/IO_Compress_Zlib/lib/IO/Compress/Adapter/Identity.pm index ad7347c..c615797 100644 --- a/ext/IO_Compress_Zlib/lib/IO/Compress/Adapter/Identity.pm +++ b/ext/IO_Compress_Zlib/lib/IO/Compress/Adapter/Identity.pm @@ -4,10 +4,10 @@ use strict; use warnings; use bytes; -use IO::Compress::Base::Common 2.011 qw(:Status); +use IO::Compress::Base::Common 2.012 qw(:Status); our ($VERSION); -$VERSION = '2.011'; +$VERSION = '2.012'; sub mkCompObject { diff --git a/ext/IO_Compress_Zlib/lib/IO/Compress/Deflate.pm b/ext/IO_Compress_Zlib/lib/IO/Compress/Deflate.pm index e702e43..0c94e8f 100644 --- a/ext/IO_Compress_Zlib/lib/IO/Compress/Deflate.pm +++ b/ext/IO_Compress_Zlib/lib/IO/Compress/Deflate.pm @@ -6,16 +6,16 @@ use bytes; require Exporter ; -use IO::Compress::RawDeflate 2.011 ; +use IO::Compress::RawDeflate 2.012 ; -use Compress::Raw::Zlib 2.011 ; -use IO::Compress::Zlib::Constants 2.011 ; -use IO::Compress::Base::Common 2.011 qw(createSelfTiedObject); +use Compress::Raw::Zlib 2.012 ; +use IO::Compress::Zlib::Constants 2.012 ; +use IO::Compress::Base::Common 2.012 qw(createSelfTiedObject); our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $DeflateError); -$VERSION = '2.011'; +$VERSION = '2.012'; $DeflateError = ''; @ISA = qw(Exporter IO::Compress::RawDeflate); diff --git a/ext/IO_Compress_Zlib/lib/IO/Compress/Gzip.pm b/ext/IO_Compress_Zlib/lib/IO/Compress/Gzip.pm index 86561c5..e7a54ea 100644 --- a/ext/IO_Compress_Zlib/lib/IO/Compress/Gzip.pm +++ b/ext/IO_Compress_Zlib/lib/IO/Compress/Gzip.pm @@ -8,12 +8,12 @@ use warnings; use bytes; -use IO::Compress::RawDeflate 2.011 ; +use IO::Compress::RawDeflate 2.012 ; -use Compress::Raw::Zlib 2.011 ; -use IO::Compress::Base::Common 2.011 qw(:Status :Parse createSelfTiedObject); -use IO::Compress::Gzip::Constants 2.011 ; -use IO::Compress::Zlib::Extra 2.011 ; +use Compress::Raw::Zlib 2.012 ; +use IO::Compress::Base::Common 2.012 qw(:Status :Parse createSelfTiedObject); +use IO::Compress::Gzip::Constants 2.012 ; +use IO::Compress::Zlib::Extra 2.012 ; BEGIN { @@ -27,7 +27,7 @@ require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $GzipError); -$VERSION = '2.011'; +$VERSION = '2.012'; $GzipError = '' ; @ISA = qw(Exporter IO::Compress::RawDeflate); diff --git a/ext/IO_Compress_Zlib/lib/IO/Compress/Gzip/Constants.pm b/ext/IO_Compress_Zlib/lib/IO/Compress/Gzip/Constants.pm index 2f59d22..1a2b35c 100644 --- a/ext/IO_Compress_Zlib/lib/IO/Compress/Gzip/Constants.pm +++ b/ext/IO_Compress_Zlib/lib/IO/Compress/Gzip/Constants.pm @@ -9,7 +9,7 @@ require Exporter; our ($VERSION, @ISA, @EXPORT, %GZIP_OS_Names); our ($GZIP_FNAME_INVALID_CHAR_RE, $GZIP_FCOMMENT_INVALID_CHAR_RE); -$VERSION = '2.011'; +$VERSION = '2.012'; @ISA = qw(Exporter); diff --git a/ext/IO_Compress_Zlib/lib/IO/Compress/RawDeflate.pm b/ext/IO_Compress_Zlib/lib/IO/Compress/RawDeflate.pm index 81245f2..8f2e36f 100644 --- a/ext/IO_Compress_Zlib/lib/IO/Compress/RawDeflate.pm +++ b/ext/IO_Compress_Zlib/lib/IO/Compress/RawDeflate.pm @@ -7,16 +7,16 @@ use warnings; use bytes; -use IO::Compress::Base 2.011 ; -use IO::Compress::Base::Common 2.011 qw(:Status createSelfTiedObject); -use IO::Compress::Adapter::Deflate 2.011 ; +use IO::Compress::Base 2.012 ; +use IO::Compress::Base::Common 2.012 qw(:Status createSelfTiedObject); +use IO::Compress::Adapter::Deflate 2.012 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %DEFLATE_CONSTANTS, %EXPORT_TAGS, $RawDeflateError); -$VERSION = '2.011'; +$VERSION = '2.012'; $RawDeflateError = ''; @ISA = qw(Exporter IO::Compress::Base); @@ -142,8 +142,8 @@ sub getZlibParams { my $self = shift ; - use IO::Compress::Base::Common 2.011 qw(:Parse); - use Compress::Raw::Zlib 2.011 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY); + use IO::Compress::Base::Common 2.012 qw(:Parse); + use Compress::Raw::Zlib 2.012 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY); return ( diff --git a/ext/IO_Compress_Zlib/lib/IO/Compress/Zip.pm b/ext/IO_Compress_Zlib/lib/IO/Compress/Zip.pm index f2ff60e..6220d98 100644 --- a/ext/IO_Compress_Zlib/lib/IO/Compress/Zip.pm +++ b/ext/IO_Compress_Zlib/lib/IO/Compress/Zip.pm @@ -4,21 +4,21 @@ use strict ; use warnings; use bytes; -use IO::Compress::Base::Common 2.011 qw(:Status createSelfTiedObject); -use IO::Compress::RawDeflate 2.011 ; -use IO::Compress::Adapter::Deflate 2.011 ; -use IO::Compress::Adapter::Identity 2.011 ; -use IO::Compress::Zlib::Extra 2.011 ; -use IO::Compress::Zip::Constants 2.011 ; +use IO::Compress::Base::Common 2.012 qw(:Status createSelfTiedObject); +use IO::Compress::RawDeflate 2.012 ; +use IO::Compress::Adapter::Deflate 2.012 ; +use IO::Compress::Adapter::Identity 2.012 ; +use IO::Compress::Zlib::Extra 2.012 ; +use IO::Compress::Zip::Constants 2.012 ; -use Compress::Raw::Zlib 2.011 qw(crc32) ; +use Compress::Raw::Zlib 2.012 qw(crc32) ; BEGIN { eval { require IO::Compress::Adapter::Bzip2 ; - import IO::Compress::Adapter::Bzip2 2.011 ; + import IO::Compress::Adapter::Bzip2 2.012 ; require IO::Compress::Bzip2 ; - import IO::Compress::Bzip2 2.011 ; + import IO::Compress::Bzip2 2.012 ; } ; } @@ -27,7 +27,7 @@ require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $ZipError); -$VERSION = '2.011'; +$VERSION = '2.012'; $ZipError = ''; @ISA = qw(Exporter IO::Compress::RawDeflate); @@ -452,8 +452,8 @@ sub getExtraParams { my $self = shift ; - use IO::Compress::Base::Common 2.011 qw(:Parse); - use Compress::Raw::Zlib 2.011 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY); + use IO::Compress::Base::Common 2.012 qw(:Parse); + use Compress::Raw::Zlib 2.012 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY); my @Bzip2 = (); diff --git a/ext/IO_Compress_Zlib/lib/IO/Compress/Zip/Constants.pm b/ext/IO_Compress_Zlib/lib/IO/Compress/Zip/Constants.pm index 85e9767..5455c37 100644 --- a/ext/IO_Compress_Zlib/lib/IO/Compress/Zip/Constants.pm +++ b/ext/IO_Compress_Zlib/lib/IO/Compress/Zip/Constants.pm @@ -7,7 +7,7 @@ require Exporter; our ($VERSION, @ISA, @EXPORT, %ZIP_CM_MIN_VERSIONS); -$VERSION = '2.011'; +$VERSION = '2.012'; @ISA = qw(Exporter); diff --git a/ext/IO_Compress_Zlib/lib/IO/Compress/Zlib/Constants.pm b/ext/IO_Compress_Zlib/lib/IO/Compress/Zlib/Constants.pm index f57f6a2..5dbabcb 100644 --- a/ext/IO_Compress_Zlib/lib/IO/Compress/Zlib/Constants.pm +++ b/ext/IO_Compress_Zlib/lib/IO/Compress/Zlib/Constants.pm @@ -9,7 +9,7 @@ require Exporter; our ($VERSION, @ISA, @EXPORT); -$VERSION = '2.011'; +$VERSION = '2.012'; @ISA = qw(Exporter); diff --git a/ext/IO_Compress_Zlib/lib/IO/Compress/Zlib/Extra.pm b/ext/IO_Compress_Zlib/lib/IO/Compress/Zlib/Extra.pm index 92109fa..e91824e 100644 --- a/ext/IO_Compress_Zlib/lib/IO/Compress/Zlib/Extra.pm +++ b/ext/IO_Compress_Zlib/lib/IO/Compress/Zlib/Extra.pm @@ -8,9 +8,9 @@ use bytes; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS); -$VERSION = '2.011'; +$VERSION = '2.012'; -use IO::Compress::Gzip::Constants 2.011 ; +use IO::Compress::Gzip::Constants 2.012 ; sub ExtraFieldError { diff --git a/ext/IO_Compress_Zlib/lib/IO/Uncompress/Adapter/Identity.pm b/ext/IO_Compress_Zlib/lib/IO/Uncompress/Adapter/Identity.pm index 91e9be2..23859eb 100644 --- a/ext/IO_Compress_Zlib/lib/IO/Uncompress/Adapter/Identity.pm +++ b/ext/IO_Compress_Zlib/lib/IO/Uncompress/Adapter/Identity.pm @@ -4,13 +4,13 @@ use warnings; use strict; use bytes; -use IO::Compress::Base::Common 2.011 qw(:Status); +use IO::Compress::Base::Common 2.012 qw(:Status); our ($VERSION); -$VERSION = '2.011'; +$VERSION = '2.012'; -use Compress::Raw::Zlib 2.011 (); +use Compress::Raw::Zlib 2.012 (); sub mkUncompObject { diff --git a/ext/IO_Compress_Zlib/lib/IO/Uncompress/Adapter/Inflate.pm b/ext/IO_Compress_Zlib/lib/IO/Uncompress/Adapter/Inflate.pm index b93b1d8..2308254 100644 --- a/ext/IO_Compress_Zlib/lib/IO/Uncompress/Adapter/Inflate.pm +++ b/ext/IO_Compress_Zlib/lib/IO/Uncompress/Adapter/Inflate.pm @@ -4,11 +4,11 @@ use strict; use warnings; use bytes; -use IO::Compress::Base::Common 2.011 qw(:Status); -use Compress::Raw::Zlib 2.011 qw(Z_OK Z_DATA_ERROR Z_STREAM_END Z_FINISH MAX_WBITS); +use IO::Compress::Base::Common 2.012 qw(:Status); +use Compress::Raw::Zlib 2.012 qw(Z_OK Z_DATA_ERROR Z_STREAM_END Z_FINISH MAX_WBITS); our ($VERSION); -$VERSION = '2.011'; +$VERSION = '2.012'; diff --git a/ext/IO_Compress_Zlib/lib/IO/Uncompress/AnyInflate.pm b/ext/IO_Compress_Zlib/lib/IO/Uncompress/AnyInflate.pm index f604acb..7cf8a59 100644 --- a/ext/IO_Compress_Zlib/lib/IO/Uncompress/AnyInflate.pm +++ b/ext/IO_Compress_Zlib/lib/IO/Uncompress/AnyInflate.pm @@ -6,22 +6,22 @@ use strict; use warnings; use bytes; -use IO::Compress::Base::Common 2.011 qw(createSelfTiedObject); +use IO::Compress::Base::Common 2.012 qw(createSelfTiedObject); -use IO::Uncompress::Adapter::Inflate 2.011 (); +use IO::Uncompress::Adapter::Inflate 2.012 (); -use IO::Uncompress::Base 2.011 ; -use IO::Uncompress::Gunzip 2.011 ; -use IO::Uncompress::Inflate 2.011 ; -use IO::Uncompress::RawInflate 2.011 ; -use IO::Uncompress::Unzip 2.011 ; +use IO::Uncompress::Base 2.012 ; +use IO::Uncompress::Gunzip 2.012 ; +use IO::Uncompress::Inflate 2.012 ; +use IO::Uncompress::RawInflate 2.012 ; +use IO::Uncompress::Unzip 2.012 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $AnyInflateError); -$VERSION = '2.011'; +$VERSION = '2.012'; $AnyInflateError = ''; @ISA = qw( Exporter IO::Uncompress::Base ); @@ -48,7 +48,7 @@ sub anyinflate sub getExtraParams { - use IO::Compress::Base::Common 2.011 qw(:Parse); + use IO::Compress::Base::Common 2.012 qw(:Parse); return ( 'RawInflate' => [1, 1, Parse_boolean, 0] ) ; } diff --git a/ext/IO_Compress_Zlib/lib/IO/Uncompress/Gunzip.pm b/ext/IO_Compress_Zlib/lib/IO/Uncompress/Gunzip.pm index 494cc38..b298594 100644 --- a/ext/IO_Compress_Zlib/lib/IO/Uncompress/Gunzip.pm +++ b/ext/IO_Compress_Zlib/lib/IO/Uncompress/Gunzip.pm @@ -9,12 +9,12 @@ use strict ; use warnings; use bytes; -use IO::Uncompress::RawInflate 2.011 ; +use IO::Uncompress::RawInflate 2.012 ; -use Compress::Raw::Zlib 2.011 qw( crc32 ) ; -use IO::Compress::Base::Common 2.011 qw(:Status createSelfTiedObject); -use IO::Compress::Gzip::Constants 2.011 ; -use IO::Compress::Zlib::Extra 2.011 ; +use Compress::Raw::Zlib 2.012 qw( crc32 ) ; +use IO::Compress::Base::Common 2.012 qw(:Status createSelfTiedObject); +use IO::Compress::Gzip::Constants 2.012 ; +use IO::Compress::Zlib::Extra 2.012 ; require Exporter ; @@ -28,7 +28,7 @@ Exporter::export_ok_tags('all'); $GunzipError = ''; -$VERSION = '2.011'; +$VERSION = '2.012'; sub new { @@ -47,7 +47,7 @@ sub gunzip sub getExtraParams { - use IO::Compress::Base::Common 2.011 qw(:Parse); + use IO::Compress::Base::Common 2.012 qw(:Parse); return ( 'ParseExtra' => [1, 1, Parse_boolean, 0] ) ; } diff --git a/ext/IO_Compress_Zlib/lib/IO/Uncompress/Inflate.pm b/ext/IO_Compress_Zlib/lib/IO/Uncompress/Inflate.pm index 1a74bf4..f369d29 100644 --- a/ext/IO_Compress_Zlib/lib/IO/Uncompress/Inflate.pm +++ b/ext/IO_Compress_Zlib/lib/IO/Uncompress/Inflate.pm @@ -5,15 +5,15 @@ use strict ; use warnings; use bytes; -use IO::Compress::Base::Common 2.011 qw(:Status createSelfTiedObject); -use IO::Compress::Zlib::Constants 2.011 ; +use IO::Compress::Base::Common 2.012 qw(:Status createSelfTiedObject); +use IO::Compress::Zlib::Constants 2.012 ; -use IO::Uncompress::RawInflate 2.011 ; +use IO::Uncompress::RawInflate 2.012 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $InflateError); -$VERSION = '2.011'; +$VERSION = '2.012'; $InflateError = ''; @ISA = qw( Exporter IO::Uncompress::RawInflate ); diff --git a/ext/IO_Compress_Zlib/lib/IO/Uncompress/RawInflate.pm b/ext/IO_Compress_Zlib/lib/IO/Uncompress/RawInflate.pm index 64f85bf..50c646c 100644 --- a/ext/IO_Compress_Zlib/lib/IO/Uncompress/RawInflate.pm +++ b/ext/IO_Compress_Zlib/lib/IO/Uncompress/RawInflate.pm @@ -5,11 +5,11 @@ use strict ; use warnings; use bytes; -use Compress::Raw::Zlib 2.011 ; -use IO::Compress::Base::Common 2.011 qw(:Status createSelfTiedObject); +use Compress::Raw::Zlib 2.012 ; +use IO::Compress::Base::Common 2.012 qw(:Status createSelfTiedObject); -use IO::Uncompress::Base 2.011 ; -use IO::Uncompress::Adapter::Inflate 2.011 ; +use IO::Uncompress::Base 2.012 ; +use IO::Uncompress::Adapter::Inflate 2.012 ; @@ -17,7 +17,7 @@ use IO::Uncompress::Adapter::Inflate 2.011 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $RawInflateError); -$VERSION = '2.011'; +$VERSION = '2.012'; $RawInflateError = ''; @ISA = qw( Exporter IO::Uncompress::Base ); diff --git a/ext/IO_Compress_Zlib/lib/IO/Uncompress/Unzip.pm b/ext/IO_Compress_Zlib/lib/IO/Uncompress/Unzip.pm index c50259f..16be675 100644 --- a/ext/IO_Compress_Zlib/lib/IO/Uncompress/Unzip.pm +++ b/ext/IO_Compress_Zlib/lib/IO/Uncompress/Unzip.pm @@ -8,14 +8,14 @@ use strict ; use warnings; use bytes; -use IO::Uncompress::RawInflate 2.011 ; -use IO::Compress::Base::Common 2.011 qw(:Status createSelfTiedObject); -use IO::Uncompress::Adapter::Inflate 2.011 ; -use IO::Uncompress::Adapter::Identity 2.011 ; -use IO::Compress::Zlib::Extra 2.011 ; -use IO::Compress::Zip::Constants 2.011 ; +use IO::Uncompress::RawInflate 2.012 ; +use IO::Compress::Base::Common 2.012 qw(:Status createSelfTiedObject); +use IO::Uncompress::Adapter::Inflate 2.012 ; +use IO::Uncompress::Adapter::Identity 2.012 ; +use IO::Compress::Zlib::Extra 2.012 ; +use IO::Compress::Zip::Constants 2.012 ; -use Compress::Raw::Zlib 2.011 qw(crc32) ; +use Compress::Raw::Zlib 2.012 qw(crc32) ; BEGIN { @@ -28,7 +28,7 @@ require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $UnzipError, %headerLookup); -$VERSION = '2.011'; +$VERSION = '2.012'; $UnzipError = ''; @ISA = qw(Exporter IO::Uncompress::RawInflate); @@ -61,7 +61,7 @@ sub unzip sub getExtraParams { - use IO::Compress::Base::Common 2.011 qw(:Parse); + use IO::Compress::Base::Common 2.012 qw(:Parse); return ( diff --git a/ext/IO_Compress_Zlib/private/MakeUtil.pm b/ext/IO_Compress_Zlib/private/MakeUtil.pm index 974b761..4c706e0 100644 --- a/ext/IO_Compress_Zlib/private/MakeUtil.pm +++ b/ext/IO_Compress_Zlib/private/MakeUtil.pm @@ -49,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: diff --git a/ext/IO_Compress_Zlib/t/006zip.t b/ext/IO_Compress_Zlib/t/006zip.t index 13b6ad7..fdb28ee 100644 --- a/ext/IO_Compress_Zlib/t/006zip.t +++ b/ext/IO_Compress_Zlib/t/006zip.t @@ -19,7 +19,7 @@ BEGIN { $extra = 1 if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 }; - plan tests => 62 + $extra ; + plan tests => 77 + $extra ; use_ok('IO::Compress::Zip', qw(:all)) ; use_ok('IO::Uncompress::Unzip', qw(unzip $UnzipError)) ; @@ -248,3 +248,29 @@ SKIP: is $got[2], $content[2], "Got 3nd entry"; } + +SKIP: +for my $method (ZIP_CM_DEFLATE, ZIP_CM_STORE, ZIP_CM_BZIP2) +{ + title "Read a line from zip, Method $method"; + + skip "IO::Compress::Bzip2 not available", 14 + unless defined $IO::Compress::Bzip2::VERSION; + + my $content = "a single line\n"; + my $zip ; + + my $status = zip \$content => \$zip, + Method => $method, + Stream => 0, + Name => "123"; + is $status, 1, " Created a zip file"; + + my $u = new IO::Uncompress::Unzip \$zip; + isa_ok $u, "IO::Uncompress::Unzip"; + + is $u->getline, $content, " Read first line ok"; + ok ! $u->getline, " Second line doesn't exist"; + + +} diff --git a/t/lib/compress/destroy.pl b/t/lib/compress/destroy.pl index 9107b15..186520d 100644 --- a/t/lib/compress/destroy.pl +++ b/t/lib/compress/destroy.pl @@ -17,7 +17,7 @@ BEGIN $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 @@ EOM 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 --git a/t/lib/compress/generic.pl b/t/lib/compress/generic.pl index e2f7a2a..befe281 100644 --- a/t/lib/compress/generic.pl +++ b/t/lib/compress/generic.pl @@ -119,6 +119,7 @@ sub run } + { title "Testing $CompressClass and $UncompressClass";