From 101c03fac6d3b85ba1a8c5ef6b9e48600e1f429f Mon Sep 17 00:00:00 2001 From: Chris 'BinGOs' Williams Date: Wed, 22 Jun 2011 17:10:36 +0100 Subject: [PATCH] Update IO-Compress to CPAN version 2.037 [DELTA] 2.037 22 June 2011 * IO::Uncompress - get globmapper tests working on VMS [RT# 68926] * IO::Uncompress::Unzip - Fixed limitation where Streamed Stored content was not supported. --- MANIFEST | 1 + Porting/Maintainers.pl | 2 +- cpan/IO-Compress/Changes | 9 ++ cpan/IO-Compress/Makefile.PL | 2 +- cpan/IO-Compress/README | 6 +- cpan/IO-Compress/lib/Compress/Zlib.pm | 12 +- cpan/IO-Compress/lib/IO/Compress/Adapter/Bzip2.pm | 6 +- .../IO-Compress/lib/IO/Compress/Adapter/Deflate.pm | 6 +- .../lib/IO/Compress/Adapter/Identity.pm | 4 +- cpan/IO-Compress/lib/IO/Compress/Base.pm | 4 +- cpan/IO-Compress/lib/IO/Compress/Base/Common.pm | 2 +- cpan/IO-Compress/lib/IO/Compress/Bzip2.pm | 10 +- cpan/IO-Compress/lib/IO/Compress/Deflate.pm | 10 +- cpan/IO-Compress/lib/IO/Compress/Gzip.pm | 12 +- cpan/IO-Compress/lib/IO/Compress/Gzip/Constants.pm | 2 +- cpan/IO-Compress/lib/IO/Compress/RawDeflate.pm | 12 +- cpan/IO-Compress/lib/IO/Compress/Zip.pm | 26 ++--- cpan/IO-Compress/lib/IO/Compress/Zip/Constants.pm | 3 +- cpan/IO-Compress/lib/IO/Compress/Zlib/Constants.pm | 2 +- cpan/IO-Compress/lib/IO/Compress/Zlib/Extra.pm | 4 +- .../lib/IO/Uncompress/Adapter/Bunzip2.pm | 6 +- .../lib/IO/Uncompress/Adapter/Identity.pm | 121 +++++++++++++++++---- .../lib/IO/Uncompress/Adapter/Inflate.pm | 6 +- cpan/IO-Compress/lib/IO/Uncompress/AnyInflate.pm | 18 +-- .../IO-Compress/lib/IO/Uncompress/AnyUncompress.pm | 34 +++--- cpan/IO-Compress/lib/IO/Uncompress/Base.pm | 4 +- cpan/IO-Compress/lib/IO/Uncompress/Bunzip2.pm | 10 +- cpan/IO-Compress/lib/IO/Uncompress/Gunzip.pm | 14 +-- cpan/IO-Compress/lib/IO/Uncompress/Inflate.pm | 8 +- cpan/IO-Compress/lib/IO/Uncompress/RawInflate.pm | 10 +- cpan/IO-Compress/lib/IO/Uncompress/Unzip.pm | 25 ++--- cpan/IO-Compress/t/000prereq.t | 2 +- cpan/IO-Compress/t/105oneshot-zip-bzip2-only.t | 18 +-- cpan/IO-Compress/t/105oneshot-zip-only.t | 18 +-- cpan/IO-Compress/t/105oneshot-zip-store-only.t | 98 +++++++++++++++++ cpan/IO-Compress/t/compress/CompTestUtils.pm | 12 ++ pod/perldelta.pod | 5 +- 37 files changed, 358 insertions(+), 186 deletions(-) create mode 100644 cpan/IO-Compress/t/105oneshot-zip-store-only.t diff --git a/MANIFEST b/MANIFEST index d26b743..5fde71d 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1243,6 +1243,7 @@ cpan/IO-Compress/t/105oneshot-gzip.t IO::Compress cpan/IO-Compress/t/105oneshot-rawdeflate.t IO::Compress cpan/IO-Compress/t/105oneshot-zip-bzip2-only.t IO::Compress cpan/IO-Compress/t/105oneshot-zip-only.t IO::Compress +cpan/IO-Compress/t/105oneshot-zip-store-only.t IO::Compress cpan/IO-Compress/t/105oneshot-zip.t IO::Compress cpan/IO-Compress/t/106prime-bzip2.t IO::Compress cpan/IO-Compress/t/106prime-deflate.t IO::Compress diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index f7172cf..3904314 100755 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -1036,7 +1036,7 @@ use File::Glob qw(:case); 'IO-Compress' => { 'MAINTAINER' => 'pmqs', - 'DISTRIBUTION' => 'PMQS/IO-Compress-2.036.tar.gz', + 'DISTRIBUTION' => 'PMQS/IO-Compress-2.037.tar.gz', 'FILES' => q[cpan/IO-Compress], 'EXCLUDED' => [ qr{t/Test/} ], 'UPSTREAM' => 'cpan', diff --git a/cpan/IO-Compress/Changes b/cpan/IO-Compress/Changes index b312306..675689c 100644 --- a/cpan/IO-Compress/Changes +++ b/cpan/IO-Compress/Changes @@ -1,6 +1,15 @@ CHANGES ------- + 2.037 22 June 2011 + + * IO::Uncompress + - get globmapper tests working on VMS + [RT# 68926] + + * IO::Uncompress::Unzip + - Fixed limitation where Streamed Stored content was not supported. + 2.036 18 June 2011 * IO::Compress::Zip & IO::Uncompress::Unzip diff --git a/cpan/IO-Compress/Makefile.PL b/cpan/IO-Compress/Makefile.PL index 056f537..3cb6272 100644 --- a/cpan/IO-Compress/Makefile.PL +++ b/cpan/IO-Compress/Makefile.PL @@ -3,7 +3,7 @@ use strict ; require 5.004 ; -$::VERSION = '2.036' ; +$::VERSION = '2.037' ; use private::MakeUtil; use ExtUtils::MakeMaker 5.16 ; diff --git a/cpan/IO-Compress/README b/cpan/IO-Compress/README index 6a4330e..6f51a80 100644 --- a/cpan/IO-Compress/README +++ b/cpan/IO-Compress/README @@ -1,9 +1,9 @@ IO-Compress - Version 2.036 + Version 2.037 - 18th June 2011 + 22nd June 2011 Copyright (c) 1995-2011 Paul Marquess. All rights reserved. This program is free software; you can redistribute it @@ -89,7 +89,7 @@ To help me help you, I need all of the following information: If you haven't installed IO-Compress then search IO::Compress::Gzip.pm for a line like this: - $VERSION = "2.036" ; + $VERSION = "2.037" ; 2. If you are having problems building IO-Compress, send me a complete log of what happened. Start by unpacking the IO-Compress diff --git a/cpan/IO-Compress/lib/Compress/Zlib.pm b/cpan/IO-Compress/lib/Compress/Zlib.pm index 025d873..5c19ccb 100644 --- a/cpan/IO-Compress/lib/Compress/Zlib.pm +++ b/cpan/IO-Compress/lib/Compress/Zlib.pm @@ -7,17 +7,17 @@ use Carp ; use IO::Handle ; use Scalar::Util qw(dualvar); -use IO::Compress::Base::Common 2.036 ; -use Compress::Raw::Zlib 2.036 ; -use IO::Compress::Gzip 2.036 ; -use IO::Uncompress::Gunzip 2.036 ; +use IO::Compress::Base::Common 2.037 ; +use Compress::Raw::Zlib 2.037 ; +use IO::Compress::Gzip 2.037 ; +use IO::Uncompress::Gunzip 2.037 ; use strict ; use warnings ; use bytes ; our ($VERSION, $XS_VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); -$VERSION = '2.036'; +$VERSION = '2.037'; $XS_VERSION = $VERSION; $VERSION = eval $VERSION; @@ -453,7 +453,7 @@ sub inflate package Compress::Zlib ; -use IO::Compress::Gzip::Constants 2.036 ; +use IO::Compress::Gzip::Constants 2.037 ; sub memGzip($) { diff --git a/cpan/IO-Compress/lib/IO/Compress/Adapter/Bzip2.pm b/cpan/IO-Compress/lib/IO/Compress/Adapter/Bzip2.pm index d72008c..ca351e2 100644 --- a/cpan/IO-Compress/lib/IO/Compress/Adapter/Bzip2.pm +++ b/cpan/IO-Compress/lib/IO/Compress/Adapter/Bzip2.pm @@ -4,13 +4,13 @@ use strict; use warnings; use bytes; -use IO::Compress::Base::Common 2.036 qw(:Status); +use IO::Compress::Base::Common 2.037 qw(:Status); #use Compress::Bzip2 ; -use Compress::Raw::Bzip2 2.036 ; +use Compress::Raw::Bzip2 2.037 ; our ($VERSION); -$VERSION = '2.036'; +$VERSION = '2.037'; sub mkCompObject { diff --git a/cpan/IO-Compress/lib/IO/Compress/Adapter/Deflate.pm b/cpan/IO-Compress/lib/IO/Compress/Adapter/Deflate.pm index ae060ee..91e5843 100644 --- a/cpan/IO-Compress/lib/IO/Compress/Adapter/Deflate.pm +++ b/cpan/IO-Compress/lib/IO/Compress/Adapter/Deflate.pm @@ -4,12 +4,12 @@ use strict; use warnings; use bytes; -use IO::Compress::Base::Common 2.036 qw(:Status); +use IO::Compress::Base::Common 2.037 qw(:Status); -use Compress::Raw::Zlib 2.036 qw(Z_OK Z_FINISH MAX_WBITS) ; +use Compress::Raw::Zlib 2.037 qw(Z_OK Z_FINISH MAX_WBITS) ; our ($VERSION); -$VERSION = '2.036'; +$VERSION = '2.037'; sub mkCompObject { diff --git a/cpan/IO-Compress/lib/IO/Compress/Adapter/Identity.pm b/cpan/IO-Compress/lib/IO/Compress/Adapter/Identity.pm index c0b4eef..c48c888 100644 --- a/cpan/IO-Compress/lib/IO/Compress/Adapter/Identity.pm +++ b/cpan/IO-Compress/lib/IO/Compress/Adapter/Identity.pm @@ -4,10 +4,10 @@ use strict; use warnings; use bytes; -use IO::Compress::Base::Common 2.036 qw(:Status); +use IO::Compress::Base::Common 2.037 qw(:Status); our ($VERSION); -$VERSION = '2.036'; +$VERSION = '2.037'; sub mkCompObject { diff --git a/cpan/IO-Compress/lib/IO/Compress/Base.pm b/cpan/IO-Compress/lib/IO/Compress/Base.pm index cbfaa00..6f491f6 100644 --- a/cpan/IO-Compress/lib/IO/Compress/Base.pm +++ b/cpan/IO-Compress/lib/IO/Compress/Base.pm @@ -6,7 +6,7 @@ require 5.004 ; use strict ; use warnings; -use IO::Compress::Base::Common 2.036 ; +use IO::Compress::Base::Common 2.037 ; use IO::File qw(SEEK_SET SEEK_END); ; use Scalar::Util qw(blessed readonly); @@ -20,7 +20,7 @@ use bytes; our (@ISA, $VERSION); @ISA = qw(Exporter IO::File); -$VERSION = '2.036'; +$VERSION = '2.037'; #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. diff --git a/cpan/IO-Compress/lib/IO/Compress/Base/Common.pm b/cpan/IO-Compress/lib/IO/Compress/Base/Common.pm index 01c608b..b6d3342 100644 --- a/cpan/IO-Compress/lib/IO/Compress/Base/Common.pm +++ b/cpan/IO-Compress/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.036'; +$VERSION = '2.037'; @EXPORT = qw( isaFilehandle isaFilename whatIsInput whatIsOutput isaFileGlobString cleanFileGlobString oneTarget diff --git a/cpan/IO-Compress/lib/IO/Compress/Bzip2.pm b/cpan/IO-Compress/lib/IO/Compress/Bzip2.pm index 19138ea..e4bb983 100644 --- a/cpan/IO-Compress/lib/IO/Compress/Bzip2.pm +++ b/cpan/IO-Compress/lib/IO/Compress/Bzip2.pm @@ -5,16 +5,16 @@ use warnings; use bytes; require Exporter ; -use IO::Compress::Base 2.036 ; +use IO::Compress::Base 2.037 ; -use IO::Compress::Base::Common 2.036 qw(createSelfTiedObject); -use IO::Compress::Adapter::Bzip2 2.036 ; +use IO::Compress::Base::Common 2.037 qw(createSelfTiedObject); +use IO::Compress::Adapter::Bzip2 2.037 ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $Bzip2Error); -$VERSION = '2.036'; +$VERSION = '2.037'; $Bzip2Error = ''; @ISA = qw(Exporter IO::Compress::Base); @@ -51,7 +51,7 @@ sub getExtraParams { my $self = shift ; - use IO::Compress::Base::Common 2.036 qw(:Parse); + use IO::Compress::Base::Common 2.037 qw(:Parse); return ( 'BlockSize100K' => [0, 1, Parse_unsigned, 1], diff --git a/cpan/IO-Compress/lib/IO/Compress/Deflate.pm b/cpan/IO-Compress/lib/IO/Compress/Deflate.pm index 0041395..f2f0ce9 100644 --- a/cpan/IO-Compress/lib/IO/Compress/Deflate.pm +++ b/cpan/IO-Compress/lib/IO/Compress/Deflate.pm @@ -6,16 +6,16 @@ use bytes; require Exporter ; -use IO::Compress::RawDeflate 2.036 ; +use IO::Compress::RawDeflate 2.037 ; -use Compress::Raw::Zlib 2.036 ; -use IO::Compress::Zlib::Constants 2.036 ; -use IO::Compress::Base::Common 2.036 qw(createSelfTiedObject); +use Compress::Raw::Zlib 2.037 ; +use IO::Compress::Zlib::Constants 2.037 ; +use IO::Compress::Base::Common 2.037 qw(createSelfTiedObject); our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $DeflateError); -$VERSION = '2.036'; +$VERSION = '2.037'; $DeflateError = ''; @ISA = qw(Exporter IO::Compress::RawDeflate); diff --git a/cpan/IO-Compress/lib/IO/Compress/Gzip.pm b/cpan/IO-Compress/lib/IO/Compress/Gzip.pm index fd567a9..343d87f 100644 --- a/cpan/IO-Compress/lib/IO/Compress/Gzip.pm +++ b/cpan/IO-Compress/lib/IO/Compress/Gzip.pm @@ -8,12 +8,12 @@ use warnings; use bytes; -use IO::Compress::RawDeflate 2.036 ; +use IO::Compress::RawDeflate 2.037 ; -use Compress::Raw::Zlib 2.036 ; -use IO::Compress::Base::Common 2.036 qw(:Status :Parse createSelfTiedObject); -use IO::Compress::Gzip::Constants 2.036 ; -use IO::Compress::Zlib::Extra 2.036 ; +use Compress::Raw::Zlib 2.037 ; +use IO::Compress::Base::Common 2.037 qw(:Status :Parse createSelfTiedObject); +use IO::Compress::Gzip::Constants 2.037 ; +use IO::Compress::Zlib::Extra 2.037 ; BEGIN { @@ -27,7 +27,7 @@ require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $GzipError); -$VERSION = '2.036'; +$VERSION = '2.037'; $GzipError = '' ; @ISA = qw(Exporter IO::Compress::RawDeflate); diff --git a/cpan/IO-Compress/lib/IO/Compress/Gzip/Constants.pm b/cpan/IO-Compress/lib/IO/Compress/Gzip/Constants.pm index c196da4..918f3d2 100644 --- a/cpan/IO-Compress/lib/IO/Compress/Gzip/Constants.pm +++ b/cpan/IO-Compress/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.036'; +$VERSION = '2.037'; @ISA = qw(Exporter); diff --git a/cpan/IO-Compress/lib/IO/Compress/RawDeflate.pm b/cpan/IO-Compress/lib/IO/Compress/RawDeflate.pm index 3bdce05..4c75488 100644 --- a/cpan/IO-Compress/lib/IO/Compress/RawDeflate.pm +++ b/cpan/IO-Compress/lib/IO/Compress/RawDeflate.pm @@ -7,16 +7,16 @@ use warnings; use bytes; -use IO::Compress::Base 2.036 ; -use IO::Compress::Base::Common 2.036 qw(:Status createSelfTiedObject); -use IO::Compress::Adapter::Deflate 2.036 ; +use IO::Compress::Base 2.037 ; +use IO::Compress::Base::Common 2.037 qw(:Status createSelfTiedObject); +use IO::Compress::Adapter::Deflate 2.037 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %DEFLATE_CONSTANTS, %EXPORT_TAGS, $RawDeflateError); -$VERSION = '2.036'; +$VERSION = '2.037'; $RawDeflateError = ''; @ISA = qw(Exporter IO::Compress::Base); @@ -142,8 +142,8 @@ sub getZlibParams { my $self = shift ; - use IO::Compress::Base::Common 2.036 qw(:Parse); - use Compress::Raw::Zlib 2.036 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY); + use IO::Compress::Base::Common 2.037 qw(:Parse); + use Compress::Raw::Zlib 2.037 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY); return ( diff --git a/cpan/IO-Compress/lib/IO/Compress/Zip.pm b/cpan/IO-Compress/lib/IO/Compress/Zip.pm index 8e8d693..55588c0 100644 --- a/cpan/IO-Compress/lib/IO/Compress/Zip.pm +++ b/cpan/IO-Compress/lib/IO/Compress/Zip.pm @@ -4,26 +4,26 @@ use strict ; use warnings; use bytes; -use IO::Compress::Base::Common 2.036 qw(:Status createSelfTiedObject); -use IO::Compress::RawDeflate 2.036 ; -use IO::Compress::Adapter::Deflate 2.036 ; -use IO::Compress::Adapter::Identity 2.036 ; -use IO::Compress::Zlib::Extra 2.036 ; -use IO::Compress::Zip::Constants 2.036 ; +use IO::Compress::Base::Common 2.037 qw(:Status createSelfTiedObject); +use IO::Compress::RawDeflate 2.037 ; +use IO::Compress::Adapter::Deflate 2.037 ; +use IO::Compress::Adapter::Identity 2.037 ; +use IO::Compress::Zlib::Extra 2.037 ; +use IO::Compress::Zip::Constants 2.037 ; -use Compress::Raw::Zlib 2.036 qw(crc32) ; +use Compress::Raw::Zlib 2.037 qw(crc32) ; BEGIN { eval { require IO::Compress::Adapter::Bzip2 ; - import IO::Compress::Adapter::Bzip2 2.036 ; + import IO::Compress::Adapter::Bzip2 2.037 ; require IO::Compress::Bzip2 ; - import IO::Compress::Bzip2 2.036 ; + import IO::Compress::Bzip2 2.037 ; } ; eval { require IO::Compress::Adapter::Lzma ; import IO::Compress::Adapter::Lzma 2.036 ; require IO::Compress::Lzma ; - import IO::Compress::Lzma 2.036 ; + import IO::Compress::Lzma 2.037 ; } ; } @@ -32,7 +32,7 @@ require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $ZipError); -$VERSION = '2.036'; +$VERSION = '2.037'; $ZipError = ''; @ISA = qw(Exporter IO::Compress::RawDeflate); @@ -554,8 +554,8 @@ sub getExtraParams { my $self = shift ; - use IO::Compress::Base::Common 2.036 qw(:Parse); - use Compress::Raw::Zlib 2.036 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY); + use IO::Compress::Base::Common 2.037 qw(:Parse); + use Compress::Raw::Zlib 2.037 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY); my @Bzip2 = (); diff --git a/cpan/IO-Compress/lib/IO/Compress/Zip/Constants.pm b/cpan/IO-Compress/lib/IO/Compress/Zip/Constants.pm index bebd5c4..47fd751 100644 --- a/cpan/IO-Compress/lib/IO/Compress/Zip/Constants.pm +++ b/cpan/IO-Compress/lib/IO/Compress/Zip/Constants.pm @@ -7,7 +7,7 @@ require Exporter; our ($VERSION, @ISA, @EXPORT, %ZIP_CM_MIN_VERSIONS); -$VERSION = '2.036'; +$VERSION = '2.037'; @ISA = qw(Exporter); @@ -74,6 +74,7 @@ use constant ZIP_IFA_TEXT_MASK => 1; # Signatures for each of the headers use constant ZIP_LOCAL_HDR_SIG => 0x04034b50; use constant ZIP_DATA_HDR_SIG => 0x08074b50; +use constant packed_ZIP_DATA_HDR_SIG => pack "V", ZIP_DATA_HDR_SIG; use constant ZIP_CENTRAL_HDR_SIG => 0x02014b50; use constant ZIP_END_CENTRAL_HDR_SIG => 0x06054b50; use constant ZIP64_END_CENTRAL_REC_HDR_SIG => 0x06064b50; diff --git a/cpan/IO-Compress/lib/IO/Compress/Zlib/Constants.pm b/cpan/IO-Compress/lib/IO/Compress/Zlib/Constants.pm index eba9ce7..4eeab80 100644 --- a/cpan/IO-Compress/lib/IO/Compress/Zlib/Constants.pm +++ b/cpan/IO-Compress/lib/IO/Compress/Zlib/Constants.pm @@ -9,7 +9,7 @@ require Exporter; our ($VERSION, @ISA, @EXPORT); -$VERSION = '2.036'; +$VERSION = '2.037'; @ISA = qw(Exporter); diff --git a/cpan/IO-Compress/lib/IO/Compress/Zlib/Extra.pm b/cpan/IO-Compress/lib/IO/Compress/Zlib/Extra.pm index 692cc51..66d0a2e 100644 --- a/cpan/IO-Compress/lib/IO/Compress/Zlib/Extra.pm +++ b/cpan/IO-Compress/lib/IO/Compress/Zlib/Extra.pm @@ -8,9 +8,9 @@ use bytes; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS); -$VERSION = '2.036'; +$VERSION = '2.037'; -use IO::Compress::Gzip::Constants 2.036 ; +use IO::Compress::Gzip::Constants 2.037 ; sub ExtraFieldError { diff --git a/cpan/IO-Compress/lib/IO/Uncompress/Adapter/Bunzip2.pm b/cpan/IO-Compress/lib/IO/Uncompress/Adapter/Bunzip2.pm index dcc3482..026627a 100644 --- a/cpan/IO-Compress/lib/IO/Uncompress/Adapter/Bunzip2.pm +++ b/cpan/IO-Compress/lib/IO/Uncompress/Adapter/Bunzip2.pm @@ -4,12 +4,12 @@ use strict; use warnings; use bytes; -use IO::Compress::Base::Common 2.036 qw(:Status); +use IO::Compress::Base::Common 2.037 qw(:Status); -use Compress::Raw::Bzip2 2.036 ; +use Compress::Raw::Bzip2 2.037 ; our ($VERSION, @ISA); -$VERSION = '2.036'; +$VERSION = '2.037'; sub mkUncompObject { diff --git a/cpan/IO-Compress/lib/IO/Uncompress/Adapter/Identity.pm b/cpan/IO-Compress/lib/IO/Uncompress/Adapter/Identity.pm index 0ac4b21..4d36999 100644 --- a/cpan/IO-Compress/lib/IO/Uncompress/Adapter/Identity.pm +++ b/cpan/IO-Compress/lib/IO/Uncompress/Adapter/Identity.pm @@ -4,47 +4,131 @@ use warnings; use strict; use bytes; -use IO::Compress::Base::Common 2.036 qw(:Status); +use IO::Compress::Base::Common 2.037 qw(:Status); +use IO::Compress::Zip::Constants ; our ($VERSION); -$VERSION = '2.036'; +$VERSION = '2.037'; -use Compress::Raw::Zlib 2.036 (); +use Compress::Raw::Zlib 2.037 (); sub mkUncompObject { + my $streaming = shift; + my $zip64 = shift; + my $crc32 = 1; #shift ; my $adler32 = shift; - bless { 'CompSize' => 0, + bless { 'CompSize' => new U64 , # 0, 'UnCompSize' => 0, 'wantCRC32' => $crc32, 'CRC32' => Compress::Raw::Zlib::crc32(''), 'wantADLER32'=> $adler32, 'ADLER32' => Compress::Raw::Zlib::adler32(''), 'ConsumesInput' => 1, + 'Streaming' => $streaming, + 'Zip64' => $zip64, + 'DataHdrSize' => $zip64 ? 24 : 16, + 'Pending' => '', } ; } + sub uncompr { my $self = shift; + my $in = $_[0]; my $eof = $_[2]; - if (defined ${ $_[0] } && length ${ $_[0] }) { - $self->{CompSize} += length ${ $_[0] } ; - $self->{UnCompSize} = $self->{CompSize} ; - - $self->{CRC32} = Compress::Raw::Zlib::crc32($_[0], $self->{CRC32}) - if $self->{wantCRC32}; - - $self->{ADLER32} = Compress::Zlib::adler32($_[0], $self->{ADLER32}) - if $self->{wantADLER32}; - - ${ $_[1] } .= ${ $_[0] }; - ${ $_[0] } = ""; + my $len = length $$in; + my $remainder = ''; + + if (defined $$in && $len) { + + if ($self->{Streaming}) { + + if (length $self->{Pending}) { + $$in = $self->{Pending} . $$in ; + $len = length $$in; + $self->{Pending} = ''; + } + + my $ind = index($$in, "\x50\x4b\x07\x08"); + + if ($ind < 0) { + $len = length $$in; + if ($len >= 3 && substr($$in, -3) eq "\x50\x4b\x07") { + $ind = $len - 3 ; + } + elsif ($len >= 2 && substr($$in, -2) eq "\x50\x4b") { + $ind = $len - 2 ; + } + elsif ($len >= 1 && substr($$in, -1) eq "\x50") { + $ind = $len - 1 ; + } + } + + if ($ind >= 0) { + $remainder = substr($$in, $ind) ; + substr($$in, $ind) = '' ; + } + } + + if (length $remainder && length $remainder < $self->{DataHdrSize}) { + $self->{Pending} = $remainder ; + $remainder = ''; + } + elsif (length $remainder >= $self->{DataHdrSize}) { + my $crc = unpack "V", substr($remainder, 4); + if ($crc == Compress::Raw::Zlib::crc32($$in, $self->{CRC32})) { + my ($l1, $l2) ; + + if ($self->{Zip64}) { + $l1 = U64::newUnpack_V64(substr($remainder, 8)); + $l2 = U64::newUnpack_V64(substr($remainder, 16)); + } + else { + $l1 = U64::newUnpack_V32(substr($remainder, 8)); + $l2 = U64::newUnpack_V32(substr($remainder, 12)); + } + + my $newLen = $self->{CompSize}->clone(); + $newLen->add(length $$in); + if ($l1->equal($l2) && $l1->equal($newLen) ) { + $eof = 1; + } + else { + $$in .= substr($remainder, 0, 4) ; + $remainder = substr($remainder, 4); + #$self->{Pending} = substr($remainder, 4); + #$remainder = ''; + $eof = 0; + } + } + else { + $$in .= substr($remainder, 0, 4) ; + $remainder = substr($remainder, 4); + #$self->{Pending} = substr($remainder, 4); + #$remainder = ''; + $eof = 0; + } + } + + if (length $$in) { + $self->{CompSize}->add(length $$in) ; + + $self->{CRC32} = Compress::Raw::Zlib::crc32($$in, $self->{CRC32}) + if $self->{wantCRC32}; + + $self->{ADLER32} = Compress::Zlib::adler32($$in, $self->{ADLER32}) + if $self->{wantADLER32}; + } + + ${ $_[1] } .= $$in; + $$in = $remainder; } return STATUS_ENDSTREAM if $eof; @@ -63,7 +147,6 @@ sub reset return STATUS_OK ; } - #sub count #{ # my $self = shift ; @@ -73,13 +156,13 @@ sub reset sub compressedBytes { my $self = shift ; - return $self->{UnCompSize} ; + return $self->{CompSize} ; } sub uncompressedBytes { my $self = shift ; - return $self->{UnCompSize} ; + return $self->{CompSize} ; } sub sync diff --git a/cpan/IO-Compress/lib/IO/Uncompress/Adapter/Inflate.pm b/cpan/IO-Compress/lib/IO/Uncompress/Adapter/Inflate.pm index b5cb07b..ab74496 100644 --- a/cpan/IO-Compress/lib/IO/Uncompress/Adapter/Inflate.pm +++ b/cpan/IO-Compress/lib/IO/Uncompress/Adapter/Inflate.pm @@ -4,11 +4,11 @@ use strict; use warnings; use bytes; -use IO::Compress::Base::Common 2.036 qw(:Status); -use Compress::Raw::Zlib 2.036 qw(Z_OK Z_BUF_ERROR Z_STREAM_END Z_FINISH MAX_WBITS); +use IO::Compress::Base::Common 2.037 qw(:Status); +use Compress::Raw::Zlib 2.037 qw(Z_OK Z_BUF_ERROR Z_STREAM_END Z_FINISH MAX_WBITS); our ($VERSION); -$VERSION = '2.036'; +$VERSION = '2.037'; diff --git a/cpan/IO-Compress/lib/IO/Uncompress/AnyInflate.pm b/cpan/IO-Compress/lib/IO/Uncompress/AnyInflate.pm index 6efbd78..4184f0d 100644 --- a/cpan/IO-Compress/lib/IO/Uncompress/AnyInflate.pm +++ b/cpan/IO-Compress/lib/IO/Uncompress/AnyInflate.pm @@ -6,22 +6,22 @@ use strict; use warnings; use bytes; -use IO::Compress::Base::Common 2.036 qw(createSelfTiedObject); +use IO::Compress::Base::Common 2.037 qw(createSelfTiedObject); -use IO::Uncompress::Adapter::Inflate 2.036 (); +use IO::Uncompress::Adapter::Inflate 2.037 (); -use IO::Uncompress::Base 2.036 ; -use IO::Uncompress::Gunzip 2.036 ; -use IO::Uncompress::Inflate 2.036 ; -use IO::Uncompress::RawInflate 2.036 ; -use IO::Uncompress::Unzip 2.036 ; +use IO::Uncompress::Base 2.037 ; +use IO::Uncompress::Gunzip 2.037 ; +use IO::Uncompress::Inflate 2.037 ; +use IO::Uncompress::RawInflate 2.037 ; +use IO::Uncompress::Unzip 2.037 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $AnyInflateError); -$VERSION = '2.036'; +$VERSION = '2.037'; $AnyInflateError = ''; @ISA = qw( Exporter IO::Uncompress::Base ); @@ -48,7 +48,7 @@ sub anyinflate sub getExtraParams { - use IO::Compress::Base::Common 2.036 qw(:Parse); + use IO::Compress::Base::Common 2.037 qw(:Parse); return ( 'RawInflate' => [1, 1, Parse_boolean, 0] ) ; } diff --git a/cpan/IO-Compress/lib/IO/Uncompress/AnyUncompress.pm b/cpan/IO-Compress/lib/IO/Uncompress/AnyUncompress.pm index 97673fd..b7d8bf9 100644 --- a/cpan/IO-Compress/lib/IO/Uncompress/AnyUncompress.pm +++ b/cpan/IO-Compress/lib/IO/Uncompress/AnyUncompress.pm @@ -4,16 +4,16 @@ use strict; use warnings; use bytes; -use IO::Compress::Base::Common 2.036 qw(createSelfTiedObject); +use IO::Compress::Base::Common 2.037 qw(createSelfTiedObject); -use IO::Uncompress::Base 2.036 ; +use IO::Uncompress::Base 2.037 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $AnyUncompressError); -$VERSION = '2.036'; +$VERSION = '2.037'; $AnyUncompressError = ''; @ISA = qw( Exporter IO::Uncompress::Base ); @@ -27,22 +27,22 @@ Exporter::export_ok_tags('all'); BEGIN { - eval ' use IO::Uncompress::Adapter::Inflate 2.036 ;'; - eval ' use IO::Uncompress::Adapter::Bunzip2 2.036 ;'; - eval ' use IO::Uncompress::Adapter::LZO 2.036 ;'; - eval ' use IO::Uncompress::Adapter::Lzf 2.036 ;'; + eval ' use IO::Uncompress::Adapter::Inflate 2.037 ;'; + eval ' use IO::Uncompress::Adapter::Bunzip2 2.037 ;'; + eval ' use IO::Uncompress::Adapter::LZO 2.037 ;'; + eval ' use IO::Uncompress::Adapter::Lzf 2.037 ;'; eval ' use IO::Uncompress::Adapter::UnLzma 2.020 ;'; eval ' use IO::Uncompress::Adapter::UnXz 2.020 ;'; - eval ' use IO::Uncompress::Bunzip2 2.036 ;'; - eval ' use IO::Uncompress::UnLzop 2.036 ;'; - eval ' use IO::Uncompress::Gunzip 2.036 ;'; - eval ' use IO::Uncompress::Inflate 2.036 ;'; - eval ' use IO::Uncompress::RawInflate 2.036 ;'; - eval ' use IO::Uncompress::Unzip 2.036 ;'; - eval ' use IO::Uncompress::UnLzf 2.036 ;'; - eval ' use IO::Uncompress::UnLzma 2.036 ;'; - eval ' use IO::Uncompress::UnXz 2.036 ;'; + eval ' use IO::Uncompress::Bunzip2 2.037 ;'; + eval ' use IO::Uncompress::UnLzop 2.037 ;'; + eval ' use IO::Uncompress::Gunzip 2.037 ;'; + eval ' use IO::Uncompress::Inflate 2.037 ;'; + eval ' use IO::Uncompress::RawInflate 2.037 ;'; + eval ' use IO::Uncompress::Unzip 2.037 ;'; + eval ' use IO::Uncompress::UnLzf 2.037 ;'; + eval ' use IO::Uncompress::UnLzma 2.037 ;'; + eval ' use IO::Uncompress::UnXz 2.037 ;'; } sub new @@ -60,7 +60,7 @@ sub anyuncompress sub getExtraParams { - use IO::Compress::Base::Common 2.036 qw(:Parse); + use IO::Compress::Base::Common 2.037 qw(:Parse); return ( 'RawInflate' => [1, 1, Parse_boolean, 0] , 'UnLzma' => [1, 1, Parse_boolean, 0] ) ; } diff --git a/cpan/IO-Compress/lib/IO/Uncompress/Base.pm b/cpan/IO-Compress/lib/IO/Uncompress/Base.pm index 7deb748..7d07477 100644 --- a/cpan/IO-Compress/lib/IO/Uncompress/Base.pm +++ b/cpan/IO-Compress/lib/IO/Uncompress/Base.pm @@ -9,12 +9,12 @@ our (@ISA, $VERSION, @EXPORT_OK, %EXPORT_TAGS); @ISA = qw(Exporter IO::File); -$VERSION = '2.036'; +$VERSION = '2.037'; use constant G_EOF => 0 ; use constant G_ERR => -1 ; -use IO::Compress::Base::Common 2.036 ; +use IO::Compress::Base::Common 2.037 ; use IO::File ; use Symbol; diff --git a/cpan/IO-Compress/lib/IO/Uncompress/Bunzip2.pm b/cpan/IO-Compress/lib/IO/Uncompress/Bunzip2.pm index 612abdc..b08ab47 100644 --- a/cpan/IO-Compress/lib/IO/Uncompress/Bunzip2.pm +++ b/cpan/IO-Compress/lib/IO/Uncompress/Bunzip2.pm @@ -4,15 +4,15 @@ use strict ; use warnings; use bytes; -use IO::Compress::Base::Common 2.036 qw(:Status createSelfTiedObject); +use IO::Compress::Base::Common 2.037 qw(:Status createSelfTiedObject); -use IO::Uncompress::Base 2.036 ; -use IO::Uncompress::Adapter::Bunzip2 2.036 ; +use IO::Uncompress::Base 2.037 ; +use IO::Uncompress::Adapter::Bunzip2 2.037 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $Bunzip2Error); -$VERSION = '2.036'; +$VERSION = '2.037'; $Bunzip2Error = ''; @ISA = qw( Exporter IO::Uncompress::Base ); @@ -40,7 +40,7 @@ sub getExtraParams { my $self = shift ; - use IO::Compress::Base::Common 2.036 qw(:Parse); + use IO::Compress::Base::Common 2.037 qw(:Parse); return ( 'Verbosity' => [1, 1, Parse_boolean, 0], diff --git a/cpan/IO-Compress/lib/IO/Uncompress/Gunzip.pm b/cpan/IO-Compress/lib/IO/Uncompress/Gunzip.pm index 61c961f..e191ee6 100644 --- a/cpan/IO-Compress/lib/IO/Uncompress/Gunzip.pm +++ b/cpan/IO-Compress/lib/IO/Uncompress/Gunzip.pm @@ -9,12 +9,12 @@ use strict ; use warnings; use bytes; -use IO::Uncompress::RawInflate 2.036 ; +use IO::Uncompress::RawInflate 2.037 ; -use Compress::Raw::Zlib 2.036 qw( crc32 ) ; -use IO::Compress::Base::Common 2.036 qw(:Status createSelfTiedObject); -use IO::Compress::Gzip::Constants 2.036 ; -use IO::Compress::Zlib::Extra 2.036 ; +use Compress::Raw::Zlib 2.037 qw( crc32 ) ; +use IO::Compress::Base::Common 2.037 qw(:Status createSelfTiedObject); +use IO::Compress::Gzip::Constants 2.037 ; +use IO::Compress::Zlib::Extra 2.037 ; require Exporter ; @@ -28,7 +28,7 @@ Exporter::export_ok_tags('all'); $GunzipError = ''; -$VERSION = '2.036'; +$VERSION = '2.037'; sub new { @@ -47,7 +47,7 @@ sub gunzip sub getExtraParams { - use IO::Compress::Base::Common 2.036 qw(:Parse); + use IO::Compress::Base::Common 2.037 qw(:Parse); return ( 'ParseExtra' => [1, 1, Parse_boolean, 0] ) ; } diff --git a/cpan/IO-Compress/lib/IO/Uncompress/Inflate.pm b/cpan/IO-Compress/lib/IO/Uncompress/Inflate.pm index 554bd3d..7435de3 100644 --- a/cpan/IO-Compress/lib/IO/Uncompress/Inflate.pm +++ b/cpan/IO-Compress/lib/IO/Uncompress/Inflate.pm @@ -5,15 +5,15 @@ use strict ; use warnings; use bytes; -use IO::Compress::Base::Common 2.036 qw(:Status createSelfTiedObject); -use IO::Compress::Zlib::Constants 2.036 ; +use IO::Compress::Base::Common 2.037 qw(:Status createSelfTiedObject); +use IO::Compress::Zlib::Constants 2.037 ; -use IO::Uncompress::RawInflate 2.036 ; +use IO::Uncompress::RawInflate 2.037 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $InflateError); -$VERSION = '2.036'; +$VERSION = '2.037'; $InflateError = ''; @ISA = qw( Exporter IO::Uncompress::RawInflate ); diff --git a/cpan/IO-Compress/lib/IO/Uncompress/RawInflate.pm b/cpan/IO-Compress/lib/IO/Uncompress/RawInflate.pm index 7aacb2d..f628eef 100644 --- a/cpan/IO-Compress/lib/IO/Uncompress/RawInflate.pm +++ b/cpan/IO-Compress/lib/IO/Uncompress/RawInflate.pm @@ -5,16 +5,16 @@ use strict ; use warnings; use bytes; -use Compress::Raw::Zlib 2.036 ; -use IO::Compress::Base::Common 2.036 qw(:Status createSelfTiedObject); +use Compress::Raw::Zlib 2.037 ; +use IO::Compress::Base::Common 2.037 qw(:Status createSelfTiedObject); -use IO::Uncompress::Base 2.036 ; -use IO::Uncompress::Adapter::Inflate 2.036 ; +use IO::Uncompress::Base 2.037 ; +use IO::Uncompress::Adapter::Inflate 2.037 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $RawInflateError); -$VERSION = '2.036'; +$VERSION = '2.037'; $RawInflateError = ''; @ISA = qw( Exporter IO::Uncompress::Base ); diff --git a/cpan/IO-Compress/lib/IO/Uncompress/Unzip.pm b/cpan/IO-Compress/lib/IO/Uncompress/Unzip.pm index 9edb795..0ef8813 100644 --- a/cpan/IO-Compress/lib/IO/Uncompress/Unzip.pm +++ b/cpan/IO-Compress/lib/IO/Uncompress/Unzip.pm @@ -9,14 +9,14 @@ use warnings; use bytes; use IO::File; -use IO::Uncompress::RawInflate 2.036 ; -use IO::Compress::Base::Common 2.036 qw(:Status createSelfTiedObject); -use IO::Uncompress::Adapter::Inflate 2.036 ; -use IO::Uncompress::Adapter::Identity 2.036 ; -use IO::Compress::Zlib::Extra 2.036 ; -use IO::Compress::Zip::Constants 2.036 ; +use IO::Uncompress::RawInflate 2.037 ; +use IO::Compress::Base::Common 2.037 qw(:Status createSelfTiedObject); +use IO::Uncompress::Adapter::Inflate 2.037 ; +use IO::Uncompress::Adapter::Identity 2.037 ; +use IO::Compress::Zlib::Extra 2.037 ; +use IO::Compress::Zip::Constants 2.037 ; -use Compress::Raw::Zlib 2.036 qw(crc32) ; +use Compress::Raw::Zlib 2.037 qw(crc32) ; BEGIN { @@ -31,7 +31,7 @@ require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $UnzipError, %headerLookup); -$VERSION = '2.036'; +$VERSION = '2.037'; $UnzipError = ''; @ISA = qw(Exporter IO::Uncompress::RawInflate); @@ -64,7 +64,7 @@ sub unzip sub getExtraParams { - use IO::Compress::Base::Common 2.036 qw(:Parse); + use IO::Compress::Base::Common 2.037 qw(:Parse); return ( @@ -551,9 +551,6 @@ sub _readZipHeader($) my @EXTRA = (); my $streamingMode = ($gpFlag & ZIP_GP_FLAG_STREAMING_MASK) ? 1 : 0 ; - return $self->HeaderError("Streamed Stored content not supported") - if $streamingMode && $compressedMethod == 0 ; - return $self->HeaderError("Encrypted content not supported") if $gpFlag & (ZIP_GP_FLAG_ENCRYPTED_MASK|ZIP_GP_FLAG_STRONG_ENCRYPTED_MASK); @@ -692,7 +689,9 @@ sub _readZipHeader($) *$self->{Type} = 'zip-stored'; - my $obj = IO::Uncompress::Adapter::Identity::mkUncompObject(); + my $obj = + IO::Uncompress::Adapter::Identity::mkUncompObject($streamingMode, + $zip64); *$self->{Uncomp} = $obj; } diff --git a/cpan/IO-Compress/t/000prereq.t b/cpan/IO-Compress/t/000prereq.t index 1ccc051..a8e5452 100644 --- a/cpan/IO-Compress/t/000prereq.t +++ b/cpan/IO-Compress/t/000prereq.t @@ -25,7 +25,7 @@ BEGIN if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 }; - my $VERSION = '2.036'; + my $VERSION = '2.037'; my @NAMES = qw( Compress::Raw::Bzip2 Compress::Raw::Zlib diff --git a/cpan/IO-Compress/t/105oneshot-zip-bzip2-only.t b/cpan/IO-Compress/t/105oneshot-zip-bzip2-only.t index f21e918..bd7393a 100644 --- a/cpan/IO-Compress/t/105oneshot-zip-bzip2-only.t +++ b/cpan/IO-Compress/t/105oneshot-zip-bzip2-only.t @@ -28,7 +28,7 @@ BEGIN { $extra = 1 if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 }; - plan tests => 144 + $extra ; + plan tests => 152 + $extra ; #use_ok('IO::Compress::Zip', qw(zip $ZipError :zip_method)) ; use_ok('IO::Compress::Zip', qw(:all)) ; @@ -88,14 +88,6 @@ for my $stream (0, 1) or diag $ZipError ; my $got ; - if ($stream && $method == ZIP_CM_STORE ) { - #eval ' unzip($file1 => \$got) '; - ok ! unzip($file1 => \$got), " unzip fails"; - like $UnzipError, "/Streamed Stored content not supported/", - " Streamed Stored content not supported"; - next ; - } - ok unzip($file1 => \$got), " unzip ok" or diag $UnzipError ; @@ -147,14 +139,6 @@ for my $stream (0, 1) for my $file ($file1, $file2) { my $got ; - if ($stream && $method == ZIP_CM_STORE ) { - #eval ' unzip($zipfile => \$got) '; - ok ! unzip($zipfile => \$got, Name => $file), " unzip fails"; - like $UnzipError, "/Streamed Stored content not supported/", - " Streamed Stored content not supported"; - next ; - } - ok unzip($zipfile => \$got, Name => $file), " unzip $file ok" or diag $UnzipError ; diff --git a/cpan/IO-Compress/t/105oneshot-zip-only.t b/cpan/IO-Compress/t/105oneshot-zip-only.t index 0906bf6..0da219e 100644 --- a/cpan/IO-Compress/t/105oneshot-zip-only.t +++ b/cpan/IO-Compress/t/105oneshot-zip-only.t @@ -23,7 +23,7 @@ BEGIN { $extra = 1 if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 }; - plan tests => 162 + $extra ; + plan tests => 170 + $extra ; #use_ok('IO::Compress::Zip', qw(zip $ZipError :zip_method)) ; use_ok('IO::Compress::Zip', qw(:all)) ; @@ -158,14 +158,6 @@ for my $stream (0, 1) or diag $ZipError ; my $got ; - if ($stream && $method == ZIP_CM_STORE ) { - #eval ' unzip($file1 => \$got) '; - ok ! unzip($file1 => \$got), " unzip fails"; - like $UnzipError, "/Streamed Stored content not supported/", - " Streamed Stored content not supported"; - next ; - } - ok unzip($file1 => \$got), " unzip ok" or diag $UnzipError ; @@ -216,14 +208,6 @@ for my $stream (0, 1) for my $file ($file1, $file2) { my $got ; - if ($stream && $method == ZIP_CM_STORE ) { - #eval ' unzip($zipfile => \$got) '; - ok ! unzip($zipfile => \$got, Name => $file), " unzip fails"; - like $UnzipError, "/Streamed Stored content not supported/", - " Streamed Stored content not supported"; - next ; - } - ok unzip($zipfile => \$got, Name => $file), " unzip $file ok" or diag $UnzipError ; diff --git a/cpan/IO-Compress/t/105oneshot-zip-store-only.t b/cpan/IO-Compress/t/105oneshot-zip-store-only.t new file mode 100644 index 0000000..84ebf0e --- /dev/null +++ b/cpan/IO-Compress/t/105oneshot-zip-store-only.t @@ -0,0 +1,98 @@ +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 { + plan(skip_all => "oneshot needs Perl 5.005 or better - you have Perl $]" ) + if $] < 5.005 ; + + plan(skip_all => "IO::Compress::Bzip2 not available" ) + unless eval { require IO::Compress::Bzip2; + require IO::Uncompress::Bunzip2; + 1 + } ; + + # use Test::NoWarnings, if available + my $extra = 0 ; + $extra = 1 + if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 }; + + plan tests => 1058 + $extra ; + + use_ok('IO::Compress::Zip', qw(:all)) ; + use_ok('IO::Uncompress::Unzip', qw(unzip $UnzipError)) ; +} + +my @contents; +my $content = "x" x 1025; +$content .= "\x50" ; + +push @contents, $content ; + +$content .= "y" x 321 ; +$content .= "\x50\x4b" ; +push @contents, $content ; + +$content .= "z" x 21 ; +$content .= "\x50\x4b\x07" . "a" x 73 ; +push @contents, $content ; + +$content .= "a" x 73 ; +$content .= "\x50\x4b\x07\x08" ; +push @contents, $content ; + +$content .= "b" x 102 ; +$content .= "\x50\x4b\x07\x08" . "\x50\x4b\x07\x08" ; +push @contents, $content ; + +$content .= "c" x 102 ; +push @contents, $content ; + + +my $index = 0; +for $content (@contents) +{ + ++ $index ; + my $contentLen = length $content ; + + + for my $stream (0, 1) + { + for my $zip64 (0, 1) + { + for my $blockSize (1 .. 7, $contentLen, $contentLen-1, $contentLen +1, 16*1024) + { + title "Index $index, Stream $stream, Zip64 $zip64, BlockSize $blockSize"; + + my $crc = Compress::Raw::Zlib::crc32($content); + $content .= "\x50\x4b\x07\x08" . pack("V", $crc) . "b" x 53 ; + + my $zipped ; + + ok zip(\$content => \$zipped , Method => ZIP_CM_STORE, + Zip64 => $zip64, + Stream => $stream), " zip ok" + or diag $ZipError ; + + my $got ; + ok unzip(\$zipped => \$got, BlockSize => $blockSize), " unzip ok" + or diag $UnzipError ; + + is $got, $content, " content ok"; + + } + } + } +} + diff --git a/cpan/IO-Compress/t/compress/CompTestUtils.pm b/cpan/IO-Compress/t/compress/CompTestUtils.pm index 644a618..9815eb2 100644 --- a/cpan/IO-Compress/t/compress/CompTestUtils.pm +++ b/cpan/IO-Compress/t/compress/CompTestUtils.pm @@ -83,6 +83,12 @@ BEGIN { { Carp::croak "NO!!!!" if defined $_; $_ = File::Temp->newdir(DIR => '.'); + # Subsequent manipulations assume Unix syntax, metacharacters, etc. + if ($^O eq 'VMS') + { + $_->{DIRNAME} = VMS::Filespec::unixify($_->{DIRNAME}); + $_->{DIRNAME} =~ s/\/$//; + } } bless [ @_ ], $self ; } @@ -92,6 +98,12 @@ BEGIN { { Carp::croak "NO!!!!" if defined $_; $_ = File::Temp::tempdir(DIR => '.', CLEANUP => 1); + # Subsequent manipulations assume Unix syntax, metacharacters, etc. + if ($^O eq 'VMS') + { + $_ = VMS::Filespec::unixify($_); + $_ =~ s/\/$//; + } } bless [ @_ ], $self ; } diff --git a/pod/perldelta.pod b/pod/perldelta.pod index eb13c50..457e4c4 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -111,10 +111,11 @@ Added offset parameter to CRC32 =item * -L has been upgraded from version 2.035 to version 2.036 +L has been upgraded from version 2.035 to version 2.037 IO::Compress::Zip and IO::Uncompress::Unzip now have support for LZMA (method 14). -There is a fix for a CRC issue in IO::Compress::Unzip. And fixed a Zip64 issue in +There is a fix for a CRC issue in IO::Compress::Unzip and it supports Streamed +Stored context now. And fixed a Zip64 issue in IO::Compress::Zip when the content size was exactly 0xFFFFFFFF. =item * -- 2.7.4