diff options
author | Nicolas R <nicolas@atoomic.org> | 2021-03-20 15:20:30 -0600 |
---|---|---|
committer | ℕicolas ℝ <nicolas@atoomic.org> | 2021-03-20 16:16:04 -0600 |
commit | 9fe6ca4a30e34d588f97a4f92bb1348f0cc1a9d7 (patch) | |
tree | 28be950a80846a6900a8c779ecde40d9f62dbb0e | |
parent | f1747b0ee406b45a9a5cce91b8c3b53eeceded6b (diff) | |
download | perl-9fe6ca4a30e34d588f97a4f92bb1348f0cc1a9d7.tar.gz |
Update IO-Compress to release 2.102
[DELTA]
2.102 28 February 2021
* Add IO_COMPRESS_SKIP_STDIN_TESTS to skip tests on Windows
https://github.com/pmqs/IO-Compress/issues/29
b0b511ec6a7dcfa4e372a8b8131767fcb39369b1
2.101 20 February 2021
* fix version numbers in meta files
34 files changed, 459 insertions, 180 deletions
diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index c6100e6589..b74d1992bf 100755 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -633,7 +633,7 @@ use File::Glob qw(:case); }, 'IO-Compress' => { - 'DISTRIBUTION' => 'PMQS/IO-Compress-2.100.tar.gz', + 'DISTRIBUTION' => 'PMQS/IO-Compress-2.102.tar.gz', 'FILES' => q[cpan/IO-Compress], 'EXCLUDED' => [ qr{^examples/}, diff --git a/cpan/IO-Compress/Makefile.PL b/cpan/IO-Compress/Makefile.PL index d55f014296..2bef5adfa4 100644 --- a/cpan/IO-Compress/Makefile.PL +++ b/cpan/IO-Compress/Makefile.PL @@ -3,7 +3,8 @@ use strict ; require 5.006 ; -$::VERSION = '2.100' ; +$::VERSION = '2.102' ; +$::DEP_VERSION = '2.101'; use lib '.'; use private::MakeUtil; @@ -24,8 +25,8 @@ WriteMakefile( ( $ENV{SKIP_FOR_CORE} ? () - : (PREREQ_PM => { 'Compress::Raw::Bzip2' => $::VERSION, - 'Compress::Raw::Zlib' => $::VERSION, + : (PREREQ_PM => { 'Compress::Raw::Bzip2' => $::DEP_VERSION, + 'Compress::Raw::Zlib' => $::DEP_VERSION, 'Scalar::Util' => 0, 'Encode' => 0, $] >= 5.005 && $] < 5.006 diff --git a/cpan/IO-Compress/bin/streamzip b/cpan/IO-Compress/bin/streamzip index 02b6c2ce63..d0f92fb620 100644 --- a/cpan/IO-Compress/bin/streamzip +++ b/cpan/IO-Compress/bin/streamzip @@ -8,20 +8,31 @@ use warnings; use IO::Compress::Zip qw(zip ZIP_CM_STORE ZIP_CM_DEFLATE - ZIP_CM_BZIP2 - ZIP_CM_LZMA ); + ZIP_CM_BZIP2 ) ; + use Getopt::Long; -my $VERSION = '1.001'; +my $VERSION = '1.002'; my $compression_method = ZIP_CM_DEFLATE; my $stream = 0; my $zipfile = '-'; my $memberName = '-' ; my $zip64 = 0 ; +my $level ; GetOptions("zip64" => \$zip64, "method=s" => \&lookupMethod, + "0" => sub { $level = 0 }, + "1" => sub { $level = 1 }, + "2" => sub { $level = 2 }, + "3" => sub { $level = 3 }, + "4" => sub { $level = 4 }, + "5" => sub { $level = 5 }, + "6" => sub { $level = 6 }, + "7" => sub { $level = 7 }, + "8" => sub { $level = 8 }, + "9" => sub { $level = 9 }, "stream" => \$stream, "zipfile=s" => \$zipfile, "member-name=s" => \$memberName, @@ -33,12 +44,19 @@ GetOptions("zip64" => \$zip64, Usage() if @ARGV; +my @extraOpts = (); + +if ($compression_method == ZIP_CM_DEFLATE && defined $level) +{ + push @extraOpts, (Level => $level) +} zip '-' => $zipfile, Name => $memberName, Zip64 => $zip64, Method => $compression_method, - Stream => $stream + Stream => $stream, + @extraOpts or die "Error creating zip file '$zipfile': $\n" ; exit 0; @@ -51,7 +69,9 @@ sub lookupMethod my %valid = ( store => ZIP_CM_STORE, deflate => ZIP_CM_DEFLATE, bzip2 => ZIP_CM_BZIP2, - lzma => ZIP_CM_LZMA, + lzma => 14, + xz => 95, + zstd => 93, ); my $method = $valid{ lc $value }; @@ -59,23 +79,33 @@ sub lookupMethod Usage("Unknown method '$value'") if ! defined $method; - # If LZMA was rquested, check that it is available - if ($method == ZIP_CM_LZMA) - { - eval ' use IO::Compress::Adapter::Lzma'; - die "Method 'LZMA' needs IO::Compress::Adapter::Lzma\n" - if ! defined $IO::Compress::Lzma::VERSION; - } + installModule("Lzma") + if $method == 14 ; + + installModule("Xz") + if $method == 95 ; + + installModule("Zstd") + if $method == 93; $compression_method = $method; } +sub installModule +{ + my $name = shift ; + + eval " use IO::Compress::$name; use IO::Compress::Adapter::$name ; " ; + die "Method '$name' needs IO::Compress::$name\n" + if $@; +} + sub Usage { print <<EOM; Usage: producer | streamzip [OPTIONS] | consumer - producer | streamzip [OPTIONS] -zipfile=output.zip + producer | streamzip [OPTIONS] -zipfile output.zip Stream data from stdin, compress into a Zip container, and stream to stdout. @@ -84,9 +114,11 @@ OPTIONS -zipfile=F Write zip container to the filename 'F' Outputs to stdout if zipfile not specified. -member-name=M Set member name to 'M' [Default '-'] + -0 ... -9 Set compression level for Deflate + [Default: 6] -zip64 Create a Zip64-compliant zip file [Default: No] Enable Zip64 if input is greater than 4Gig. - -stream Force a streamed zip file when zipfile is also enabled. + -stream Force a streamed zip file when 'zipfile' option is also enabled. Only applies when 'zipfile' option is used. [Default: No] Stream is always enabled when writing to stdout. -method=M Compress using method 'M'. @@ -95,10 +127,11 @@ OPTIONS deflate Use Deflate compression [Deflault] bzip2 Use Bzip2 compression lzma Use LZMA compression [needs IO::Compress::Lzma] - Lzma needs IO::Compress::Lzma to be installed. + xz Use LZMA compression [needs IO::Compress::Xz] + zstd Use LZMA compression [needs IO::Compress::Zstd] -version Display version number [$VERSION] -Copyright (c) 2019-2020 Paul Marquess. All rights reserved. +Copyright (c) 2019-2021 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. @@ -172,14 +205,26 @@ Valid method names are * deflate Use Deflate compression [Deflault] * bzip2 Use Bzip2 compression * lzma Use LZMA compression + * xz Use xz compression + * zstd Use Zstandard compression Note that Lzma compress needs C<IO::Compress::Lzma> to be installed. +Note that Zstd compress needs C<IO::Compress::Zstd> to be installed. + Default is C<deflate>. +=item -0, -1, -2, -3, -4, -5, -6, -7, -8, -9 + +Sets the compression level for C<deflate>. Ignored for all other compression methods. + +C<-0> means no compression and C<-9> for maximum compression. + +Default is 6 + =item -version -Display version number [$VERSION] +Display version number =item -help @@ -187,7 +232,38 @@ Display help =back -=head2 When to use a Streamed Zip File +=head2 Examples + +Create a zip file bt reading daa from stdin + + $ echo Lorem ipsum dolor sit | perl ./bin/streamzip >abcd.zip + +Check the contents of C<abcd,zip> with the standard C<unzip> utility + + Archive: abcd.zip + Length Date Time Name + --------- ---------- ----- ---- + 22 2021-01-08 19:45 - + --------- ------- + 22 1 file + +Notice how the C<Name> is set to C<->. +That is the default for a few zip utilities whwre the member name is not given. + +If you want to explicitly name the file, use the C<-member-name> option as follows + + $ echo Lorem ipsum dolor sit | perl ./bin/streamzip -member-name latin >abcd.zip + + $ unzip -l abcd.zip + Archive: abcd.zip + Length Date Time Name + --------- ---------- ----- ---- + 22 2021-01-08 19:47 latin + --------- ------- + 22 1 file + + +=head2 When to write a Streamed Zip File A Streamed Zip File is useful in situations where you cannot seek backwards/forwards in the file. @@ -211,7 +287,7 @@ Paul Marquess F<pmqs@cpan.org>. =head1 COPYRIGHT -Copyright (c) 2019-2020 Paul Marquess. All rights reserved. +Copyright (c) 2019-2021 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/cpan/IO-Compress/bin/zipdetails b/cpan/IO-Compress/bin/zipdetails index 55276af67b..9a2c5e24d0 100644 --- a/cpan/IO-Compress/bin/zipdetails +++ b/cpan/IO-Compress/bin/zipdetails @@ -203,6 +203,8 @@ my $TRAILING = 0 ; my $PAYLOADLIMIT = 256; # U64->new( 256 ); my $ZERO = U64->new( 0 ); +my $SEEN = Seen->new(); + sub prOff { my $offset = shift; @@ -868,6 +870,8 @@ sub LocalHeader my $signature = shift ; my $data = shift ; + my $from_offset = $FH->tell() - 4; + print "\n"; ++ $LocalHeaderCount; out $data, "LOCAL HEADER #" . sprintf("%X", $LocalHeaderCount) , Value_V($signature); @@ -935,6 +939,8 @@ sub LocalHeader myRead($auth, 10); out $auth, "AES Auth", hexDump($auth); } + + # $SEEN->save("LOCAL HEADER #" . sprintf("%X", $LocalHeaderCount), $filename, $from_offset, $from_offset + $CDcompressedLength) } sub outputFilename @@ -957,6 +963,8 @@ sub CentralHeader my $signature = shift ; my $data = shift ; + my $from_offset = $FH->tell() - 4; + ++ $CentralHeaderCount; print "\n"; out $data, "CENTRAL HEADER #" . sprintf("%X", $CentralHeaderCount) . "", Value_V($signature); @@ -1024,6 +1032,10 @@ sub CentralHeader myRead($comment, $comment_length); out $comment, "Comment", "'". $comment . "'"; } + + $SEEN->save("CENTRAL HEADER ref Local #" . sprintf("%X", $CentralHeaderCount), $filename, $lcl_hdr_offset, $lcl_hdr_offset + $compressedLength) ; + + # $SEEN->save("CENTRAL HEADER #" . sprintf("%X", $CentralHeaderCount), $filename, $from_offset, $FH-tell()); } sub decodeZipVer @@ -2260,6 +2272,81 @@ sub _dosToUnixTime } } +{ + package Seen; + + sub new + { + my $class = shift ; + + my %object = ( overlaps => [], + detail => [], + ) ; + + bless \%object, $class; + } + + sub save + { + my $self = shift ; + my $hdrId = shift; + my $name = shift; + my $from_offset = shift; + my $to_offset = shift ; + + for my $entry ( @{ $self->{detail} } ) + { + if ( $from_offset == $entry->{from} && $to_offset == $entry->{to} ) + { + warn "$hdrId: '$name' matches with $entry->{str}\n" + } + elsif ( ($from_offset >= $entry->{from} && $from_offset <= $entry->{to} ) || + ($to_offset >= $entry->{from} && $to_offset <= $entry->{to} ) + ) + { + # die "overlap!" + # push @{ $self->{overlap} }, + die "$hdrId: '$name' overlaps with $entry->{str}\n" + } + } + +warn "ADD $from_offset $to_offset $hdrId: $name\n"; + push @{ $self->{detail} }, + { + from => $from_offset, + to => $to_offset, + id => $hdrId, + name => $name, + str => "$hdrId: '$name'", + } ; + } + + sub summary + { + my $self = shift ; + + for my $outer ( sort { $a->{from} <=> $b->{from} } @{ $self->{detail} } ) + { + my $from_offset = $outer->{from}; + my $to_offset = $outer->{to}; + my $hdrId = $outer->{id}; + my $name = $outer->{name}; + + for my $entry ( sort { $a->{from} <=> $b->{from} } @{ $self->{detail} } ) + { + # next if + if ( ($from_offset >= $entry->{from} && $from_offset <= $entry->{to} ) || + ($to_offset >= $entry->{from} && $to_offset <= $entry->{to} ) + ) + { + # die "overlap!" + die $entry->{str} . " overlaps with $hdrId: '$name'\n" + } + } + } + } + +} sub Usage { @@ -2469,7 +2556,7 @@ Paul Marquess F<pmqs@cpan.org>. =head1 COPYRIGHT -Copyright (c) 2011-2020 Paul Marquess. All rights reserved. +Copyright (c) 2011-2021 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/cpan/IO-Compress/lib/Compress/Zlib.pm b/cpan/IO-Compress/lib/Compress/Zlib.pm index 2380271289..059571de1e 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.100 ; -use Compress::Raw::Zlib 2.100 ; -use IO::Compress::Gzip 2.100 ; -use IO::Uncompress::Gunzip 2.100 ; +use IO::Compress::Base::Common 2.101 ; +use Compress::Raw::Zlib 2.101 ; +use IO::Compress::Gzip 2.101 ; +use IO::Uncompress::Gunzip 2.101 ; use strict ; use warnings ; use bytes ; our ($VERSION, $XS_VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); -$VERSION = '2.100'; +$VERSION = '2.102'; $XS_VERSION = $VERSION; $VERSION = eval $VERSION; @@ -461,7 +461,7 @@ sub inflate package Compress::Zlib ; -use IO::Compress::Gzip::Constants 2.100 ; +use IO::Compress::Gzip::Constants 2.101 ; 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 d20b62b9b3..c157520f08 100644 --- a/cpan/IO-Compress/lib/IO/Compress/Adapter/Bzip2.pm +++ b/cpan/IO-Compress/lib/IO/Compress/Adapter/Bzip2.pm @@ -4,12 +4,12 @@ use strict; use warnings; use bytes; -use IO::Compress::Base::Common 2.100 qw(:Status); +use IO::Compress::Base::Common 2.101 qw(:Status); -use Compress::Raw::Bzip2 2.100 ; +use Compress::Raw::Bzip2 2.101 ; our ($VERSION); -$VERSION = '2.100'; +$VERSION = '2.102'; 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 fc8332ce20..1048dbda82 100644 --- a/cpan/IO-Compress/lib/IO/Compress/Adapter/Deflate.pm +++ b/cpan/IO-Compress/lib/IO/Compress/Adapter/Deflate.pm @@ -4,13 +4,13 @@ use strict; use warnings; use bytes; -use IO::Compress::Base::Common 2.100 qw(:Status); -use Compress::Raw::Zlib 2.100 qw( !crc32 !adler32 ) ; +use IO::Compress::Base::Common 2.101 qw(:Status); +use Compress::Raw::Zlib 2.101 qw( !crc32 !adler32 ) ; require Exporter; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, @EXPORT, %DEFLATE_CONSTANTS); -$VERSION = '2.100'; +$VERSION = '2.102'; @ISA = qw(Exporter); @EXPORT_OK = @Compress::Raw::Zlib::DEFLATE_CONSTANTS; %EXPORT_TAGS = %Compress::Raw::Zlib::DEFLATE_CONSTANTS; diff --git a/cpan/IO-Compress/lib/IO/Compress/Adapter/Identity.pm b/cpan/IO-Compress/lib/IO/Compress/Adapter/Identity.pm index 091e655bd4..8b92a3cea6 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.100 qw(:Status); +use IO::Compress::Base::Common 2.101 qw(:Status); our ($VERSION); -$VERSION = '2.100'; +$VERSION = '2.102'; sub mkCompObject { diff --git a/cpan/IO-Compress/lib/IO/Compress/Base.pm b/cpan/IO-Compress/lib/IO/Compress/Base.pm index bc49e01841..269f10c7a4 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.006 ; use strict ; use warnings; -use IO::Compress::Base::Common 2.100 ; +use IO::Compress::Base::Common 2.101 ; use IO::File (); ; use Scalar::Util (); @@ -20,7 +20,7 @@ use Symbol(); our (@ISA, $VERSION); @ISA = qw(IO::File Exporter); -$VERSION = '2.100'; +$VERSION = '2.102'; #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 8f0530cddd..67882cf515 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.100'; +$VERSION = '2.102'; @EXPORT = qw( isaFilehandle isaFilename isaScalar whatIsInput whatIsOutput diff --git a/cpan/IO-Compress/lib/IO/Compress/Bzip2.pm b/cpan/IO-Compress/lib/IO/Compress/Bzip2.pm index 88dd7f9bfe..2d333fd1e6 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.100 ; +use IO::Compress::Base 2.101 ; -use IO::Compress::Base::Common 2.100 qw(); -use IO::Compress::Adapter::Bzip2 2.100 ; +use IO::Compress::Base::Common 2.101 qw(); +use IO::Compress::Adapter::Bzip2 2.101 ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $Bzip2Error); -$VERSION = '2.100'; +$VERSION = '2.102'; $Bzip2Error = ''; @ISA = qw(IO::Compress::Base Exporter); @@ -51,7 +51,7 @@ sub getExtraParams { my $self = shift ; - use IO::Compress::Base::Common 2.100 qw(:Parse); + use IO::Compress::Base::Common 2.101 qw(:Parse); return ( 'blocksize100k' => [IO::Compress::Base::Common::Parse_unsigned, 1], diff --git a/cpan/IO-Compress/lib/IO/Compress/Deflate.pm b/cpan/IO-Compress/lib/IO/Compress/Deflate.pm index c3aa1eab78..9e71977df4 100644 --- a/cpan/IO-Compress/lib/IO/Compress/Deflate.pm +++ b/cpan/IO-Compress/lib/IO/Compress/Deflate.pm @@ -8,16 +8,16 @@ use bytes; require Exporter ; -use IO::Compress::RawDeflate 2.100 (); -use IO::Compress::Adapter::Deflate 2.100 ; +use IO::Compress::RawDeflate 2.101 (); +use IO::Compress::Adapter::Deflate 2.101 ; -use IO::Compress::Zlib::Constants 2.100 ; -use IO::Compress::Base::Common 2.100 qw(); +use IO::Compress::Zlib::Constants 2.101 ; +use IO::Compress::Base::Common 2.101 qw(); our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $DeflateError); -$VERSION = '2.100'; +$VERSION = '2.102'; $DeflateError = ''; @ISA = qw(IO::Compress::RawDeflate Exporter); diff --git a/cpan/IO-Compress/lib/IO/Compress/Gzip.pm b/cpan/IO-Compress/lib/IO/Compress/Gzip.pm index cf9d8e263a..4111d07938 100644 --- a/cpan/IO-Compress/lib/IO/Compress/Gzip.pm +++ b/cpan/IO-Compress/lib/IO/Compress/Gzip.pm @@ -8,12 +8,12 @@ use bytes; require Exporter ; -use IO::Compress::RawDeflate 2.100 () ; -use IO::Compress::Adapter::Deflate 2.100 ; +use IO::Compress::RawDeflate 2.101 () ; +use IO::Compress::Adapter::Deflate 2.101 ; -use IO::Compress::Base::Common 2.100 qw(:Status ); -use IO::Compress::Gzip::Constants 2.100 ; -use IO::Compress::Zlib::Extra 2.100 ; +use IO::Compress::Base::Common 2.101 qw(:Status ); +use IO::Compress::Gzip::Constants 2.101 ; +use IO::Compress::Zlib::Extra 2.101 ; BEGIN { @@ -25,7 +25,7 @@ BEGIN our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $GzipError); -$VERSION = '2.100'; +$VERSION = '2.102'; $GzipError = '' ; @ISA = qw(IO::Compress::RawDeflate Exporter); diff --git a/cpan/IO-Compress/lib/IO/Compress/Gzip/Constants.pm b/cpan/IO-Compress/lib/IO/Compress/Gzip/Constants.pm index ef67f7e66a..a3d09e2e21 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.100'; +$VERSION = '2.102'; @ISA = qw(Exporter); diff --git a/cpan/IO-Compress/lib/IO/Compress/RawDeflate.pm b/cpan/IO-Compress/lib/IO/Compress/RawDeflate.pm index a0005dd6cd..6a0ff6e0f3 100644 --- a/cpan/IO-Compress/lib/IO/Compress/RawDeflate.pm +++ b/cpan/IO-Compress/lib/IO/Compress/RawDeflate.pm @@ -6,16 +6,16 @@ use strict ; use warnings; use bytes; -use IO::Compress::Base 2.100 ; -use IO::Compress::Base::Common 2.100 qw(:Status :Parse); -use IO::Compress::Adapter::Deflate 2.100 ; -use Compress::Raw::Zlib 2.100 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY); +use IO::Compress::Base 2.101 ; +use IO::Compress::Base::Common 2.101 qw(:Status :Parse); +use IO::Compress::Adapter::Deflate 2.101 ; +use Compress::Raw::Zlib 2.101 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY); require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %DEFLATE_CONSTANTS, %EXPORT_TAGS, $RawDeflateError); -$VERSION = '2.100'; +$VERSION = '2.102'; $RawDeflateError = ''; @ISA = qw(IO::Compress::Base Exporter); diff --git a/cpan/IO-Compress/lib/IO/Compress/Zip.pm b/cpan/IO-Compress/lib/IO/Compress/Zip.pm index 16d956129e..fea487af67 100644 --- a/cpan/IO-Compress/lib/IO/Compress/Zip.pm +++ b/cpan/IO-Compress/lib/IO/Compress/Zip.pm @@ -4,41 +4,41 @@ use strict ; use warnings; use bytes; -use IO::Compress::Base::Common 2.100 qw(:Status ); -use IO::Compress::RawDeflate 2.100 (); -use IO::Compress::Adapter::Deflate 2.100 ; -use IO::Compress::Adapter::Identity 2.100 ; -use IO::Compress::Zlib::Extra 2.100 ; -use IO::Compress::Zip::Constants 2.100 ; +use IO::Compress::Base::Common 2.101 qw(:Status ); +use IO::Compress::RawDeflate 2.101 (); +use IO::Compress::Adapter::Deflate 2.101 ; +use IO::Compress::Adapter::Identity 2.101 ; +use IO::Compress::Zlib::Extra 2.101 ; +use IO::Compress::Zip::Constants 2.101 ; use File::Spec(); use Config; -use Compress::Raw::Zlib 2.100 (); +use Compress::Raw::Zlib 2.101 (); BEGIN { eval { require IO::Compress::Adapter::Bzip2 ; - IO::Compress::Adapter::Bzip2->import( 2.096 ); + IO::Compress::Adapter::Bzip2->import( 2.101 ); require IO::Compress::Bzip2 ; - IO::Compress::Bzip2->import( 2.096 ); + IO::Compress::Bzip2->import( 2.101 ); } ; eval { require IO::Compress::Adapter::Lzma ; - IO::Compress::Adapter::Lzma->import( 2.096 ); + IO::Compress::Adapter::Lzma->import( 2.101 ); require IO::Compress::Lzma ; - IO::Compress::Lzma->import( 2.096 ); + IO::Compress::Lzma->import( 2.101 ); } ; eval { require IO::Compress::Adapter::Xz ; - IO::Compress::Adapter::Xz->import( 2.096 ); + IO::Compress::Adapter::Xz->import( 2.101 ); require IO::Compress::Xz ; - IO::Compress::Xz->import( 2.096 ); + IO::Compress::Xz->import( 2.101 ); } ; eval { require IO::Compress::Adapter::Zstd ; - IO::Compress::Adapter::Zstd->import( 2.096 ); + IO::Compress::Adapter::Zstd->import( 2.101 ); require IO::Compress::Zstd ; - IO::Compress::Zstd->import( 2.096 ); + IO::Compress::Zstd->import( 2.101 ); } ; } @@ -47,7 +47,7 @@ require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $ZipError); -$VERSION = '2.100'; +$VERSION = '2.102'; $ZipError = ''; @ISA = qw(IO::Compress::RawDeflate Exporter); diff --git a/cpan/IO-Compress/lib/IO/Compress/Zip/Constants.pm b/cpan/IO-Compress/lib/IO/Compress/Zip/Constants.pm index c81a4ad56c..7982fc32f6 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.100'; +$VERSION = '2.102'; @ISA = qw(Exporter); diff --git a/cpan/IO-Compress/lib/IO/Compress/Zlib/Constants.pm b/cpan/IO-Compress/lib/IO/Compress/Zlib/Constants.pm index 1b953510b3..937101e427 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.100'; +$VERSION = '2.102'; @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 0bbef359f2..ab7446a464 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.100'; +$VERSION = '2.102'; -use IO::Compress::Gzip::Constants 2.100 ; +use IO::Compress::Gzip::Constants 2.101 ; 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 92f3945c4d..2964125105 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.100 qw(:Status); +use IO::Compress::Base::Common 2.101 qw(:Status); -use Compress::Raw::Bzip2 2.100 ; +use Compress::Raw::Bzip2 2.101 ; our ($VERSION, @ISA); -$VERSION = '2.100'; +$VERSION = '2.102'; 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 07621b4f69..4fedcae46a 100644 --- a/cpan/IO-Compress/lib/IO/Uncompress/Adapter/Identity.pm +++ b/cpan/IO-Compress/lib/IO/Uncompress/Adapter/Identity.pm @@ -4,14 +4,14 @@ use warnings; use strict; use bytes; -use IO::Compress::Base::Common 2.100 qw(:Status); +use IO::Compress::Base::Common 2.101 qw(:Status); use IO::Compress::Zip::Constants ; our ($VERSION); -$VERSION = '2.100'; +$VERSION = '2.102'; -use Compress::Raw::Zlib 2.100 (); +use Compress::Raw::Zlib 2.101 (); sub mkUncompObject { diff --git a/cpan/IO-Compress/lib/IO/Uncompress/Adapter/Inflate.pm b/cpan/IO-Compress/lib/IO/Uncompress/Adapter/Inflate.pm index 9d5dba9481..315b0c32ce 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.100 qw(:Status); -use Compress::Raw::Zlib 2.100 qw(Z_OK Z_BUF_ERROR Z_STREAM_END Z_FINISH MAX_WBITS); +use IO::Compress::Base::Common 2.101 qw(:Status); +use Compress::Raw::Zlib 2.101 qw(Z_OK Z_BUF_ERROR Z_STREAM_END Z_FINISH MAX_WBITS); our ($VERSION); -$VERSION = '2.100'; +$VERSION = '2.102'; diff --git a/cpan/IO-Compress/lib/IO/Uncompress/AnyInflate.pm b/cpan/IO-Compress/lib/IO/Uncompress/AnyInflate.pm index 7e2066d4e8..6de82bae87 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.100 qw(:Parse); +use IO::Compress::Base::Common 2.101 qw(:Parse); -use IO::Uncompress::Adapter::Inflate 2.100 (); +use IO::Uncompress::Adapter::Inflate 2.101 (); -use IO::Uncompress::Base 2.100 ; -use IO::Uncompress::Gunzip 2.100 ; -use IO::Uncompress::Inflate 2.100 ; -use IO::Uncompress::RawInflate 2.100 ; -use IO::Uncompress::Unzip 2.100 ; +use IO::Uncompress::Base 2.101 ; +use IO::Uncompress::Gunzip 2.101 ; +use IO::Uncompress::Inflate 2.101 ; +use IO::Uncompress::RawInflate 2.101 ; +use IO::Uncompress::Unzip 2.101 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $AnyInflateError); -$VERSION = '2.100'; +$VERSION = '2.102'; $AnyInflateError = ''; @ISA = qw(IO::Uncompress::Base Exporter); diff --git a/cpan/IO-Compress/lib/IO/Uncompress/AnyUncompress.pm b/cpan/IO-Compress/lib/IO/Uncompress/AnyUncompress.pm index b17a3edbda..c922220ac2 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.100 (); +use IO::Compress::Base::Common 2.101 (); -use IO::Uncompress::Base 2.100 ; +use IO::Uncompress::Base 2.101 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $AnyUncompressError); -$VERSION = '2.100'; +$VERSION = '2.102'; $AnyUncompressError = ''; @ISA = qw(IO::Uncompress::Base Exporter); @@ -33,26 +33,26 @@ BEGIN # Don't trigger any __DIE__ Hooks. local $SIG{__DIE__}; - eval ' use IO::Uncompress::Adapter::Inflate 2.100 ;'; - eval ' use IO::Uncompress::Adapter::Bunzip2 2.100 ;'; - eval ' use IO::Uncompress::Adapter::LZO 2.100 ;'; - eval ' use IO::Uncompress::Adapter::Lzf 2.100 ;'; - eval ' use IO::Uncompress::Adapter::UnLzma 2.100 ;'; - eval ' use IO::Uncompress::Adapter::UnXz 2.100 ;'; - eval ' use IO::Uncompress::Adapter::UnZstd 2.100 ;'; - eval ' use IO::Uncompress::Adapter::UnLzip 2.100 ;'; - - eval ' use IO::Uncompress::Bunzip2 2.100 ;'; - eval ' use IO::Uncompress::UnLzop 2.100 ;'; - eval ' use IO::Uncompress::Gunzip 2.100 ;'; - eval ' use IO::Uncompress::Inflate 2.100 ;'; - eval ' use IO::Uncompress::RawInflate 2.100 ;'; - eval ' use IO::Uncompress::Unzip 2.100 ;'; - eval ' use IO::Uncompress::UnLzf 2.100 ;'; - eval ' use IO::Uncompress::UnLzma 2.100 ;'; - eval ' use IO::Uncompress::UnXz 2.100 ;'; - eval ' use IO::Uncompress::UnZstd 2.100 ;'; - eval ' use IO::Uncompress::UnLzip 2.100 ;'; + eval ' use IO::Uncompress::Adapter::Inflate 2.101 ;'; + eval ' use IO::Uncompress::Adapter::Bunzip2 2.101 ;'; + eval ' use IO::Uncompress::Adapter::LZO 2.101 ;'; + eval ' use IO::Uncompress::Adapter::Lzf 2.101 ;'; + eval ' use IO::Uncompress::Adapter::UnLzma 2.101 ;'; + eval ' use IO::Uncompress::Adapter::UnXz 2.101 ;'; + eval ' use IO::Uncompress::Adapter::UnZstd 2.101 ;'; + eval ' use IO::Uncompress::Adapter::UnLzip 2.101 ;'; + + eval ' use IO::Uncompress::Bunzip2 2.101 ;'; + eval ' use IO::Uncompress::UnLzop 2.101 ;'; + eval ' use IO::Uncompress::Gunzip 2.101 ;'; + eval ' use IO::Uncompress::Inflate 2.101 ;'; + eval ' use IO::Uncompress::RawInflate 2.101 ;'; + eval ' use IO::Uncompress::Unzip 2.101 ;'; + eval ' use IO::Uncompress::UnLzf 2.101 ;'; + eval ' use IO::Uncompress::UnLzma 2.101 ;'; + eval ' use IO::Uncompress::UnXz 2.101 ;'; + eval ' use IO::Uncompress::UnZstd 2.101 ;'; + eval ' use IO::Uncompress::UnLzip 2.101 ;'; } diff --git a/cpan/IO-Compress/lib/IO/Uncompress/Base.pm b/cpan/IO-Compress/lib/IO/Uncompress/Base.pm index 5627bc6a44..31a34eb3f0 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(IO::File Exporter); -$VERSION = '2.100'; +$VERSION = '2.102'; use constant G_EOF => 0 ; use constant G_ERR => -1 ; -use IO::Compress::Base::Common 2.100 ; +use IO::Compress::Base::Common 2.101 ; 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 1bc8ac2b0e..38fff645a3 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.100 qw(:Status ); +use IO::Compress::Base::Common 2.101 qw(:Status ); -use IO::Uncompress::Base 2.100 ; -use IO::Uncompress::Adapter::Bunzip2 2.100 ; +use IO::Uncompress::Base 2.101 ; +use IO::Uncompress::Adapter::Bunzip2 2.101 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $Bunzip2Error); -$VERSION = '2.100'; +$VERSION = '2.102'; $Bunzip2Error = ''; @ISA = qw(IO::Uncompress::Base Exporter); diff --git a/cpan/IO-Compress/lib/IO/Uncompress/Gunzip.pm b/cpan/IO-Compress/lib/IO/Uncompress/Gunzip.pm index 2c2529d53b..54757132a6 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.100 ; +use IO::Uncompress::RawInflate 2.101 ; -use Compress::Raw::Zlib 2.100 () ; -use IO::Compress::Base::Common 2.100 qw(:Status ); -use IO::Compress::Gzip::Constants 2.100 ; -use IO::Compress::Zlib::Extra 2.100 ; +use Compress::Raw::Zlib 2.101 () ; +use IO::Compress::Base::Common 2.101 qw(:Status ); +use IO::Compress::Gzip::Constants 2.101 ; +use IO::Compress::Zlib::Extra 2.101 ; require Exporter ; @@ -28,7 +28,7 @@ Exporter::export_ok_tags('all'); $GunzipError = ''; -$VERSION = '2.100'; +$VERSION = '2.102'; sub new { diff --git a/cpan/IO-Compress/lib/IO/Uncompress/Inflate.pm b/cpan/IO-Compress/lib/IO/Uncompress/Inflate.pm index 5621959af9..26d2e38aca 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.100 qw(:Status ); -use IO::Compress::Zlib::Constants 2.100 ; +use IO::Compress::Base::Common 2.101 qw(:Status ); +use IO::Compress::Zlib::Constants 2.101 ; -use IO::Uncompress::RawInflate 2.100 ; +use IO::Uncompress::RawInflate 2.101 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $InflateError); -$VERSION = '2.100'; +$VERSION = '2.102'; $InflateError = ''; @ISA = qw(IO::Uncompress::RawInflate Exporter); diff --git a/cpan/IO-Compress/lib/IO/Uncompress/RawInflate.pm b/cpan/IO-Compress/lib/IO/Uncompress/RawInflate.pm index 1a6c1f5860..5d7d2e0258 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.100 ; -use IO::Compress::Base::Common 2.100 qw(:Status ); +use Compress::Raw::Zlib 2.101 ; +use IO::Compress::Base::Common 2.101 qw(:Status ); -use IO::Uncompress::Base 2.100 ; -use IO::Uncompress::Adapter::Inflate 2.100 ; +use IO::Uncompress::Base 2.101 ; +use IO::Uncompress::Adapter::Inflate 2.101 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $RawInflateError); -$VERSION = '2.100'; +$VERSION = '2.102'; $RawInflateError = ''; @ISA = qw(IO::Uncompress::Base Exporter); diff --git a/cpan/IO-Compress/lib/IO/Uncompress/Unzip.pm b/cpan/IO-Compress/lib/IO/Uncompress/Unzip.pm index 55eb89e010..98fcea71a9 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.100 ; -use IO::Compress::Base::Common 2.100 qw(:Status ); -use IO::Uncompress::Adapter::Inflate 2.100 ; -use IO::Uncompress::Adapter::Identity 2.100 ; -use IO::Compress::Zlib::Extra 2.100 ; -use IO::Compress::Zip::Constants 2.100 ; +use IO::Uncompress::RawInflate 2.101 ; +use IO::Compress::Base::Common 2.101 qw(:Status ); +use IO::Uncompress::Adapter::Inflate 2.101 ; +use IO::Uncompress::Adapter::Identity 2.101 ; +use IO::Compress::Zlib::Extra 2.101 ; +use IO::Compress::Zip::Constants 2.101 ; -use Compress::Raw::Zlib 2.100 () ; +use Compress::Raw::Zlib 2.101 () ; BEGIN { @@ -38,7 +38,7 @@ require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $UnzipError, %headerLookup); -$VERSION = '2.100'; +$VERSION = '2.102'; $UnzipError = ''; @ISA = qw(IO::Uncompress::RawInflate Exporter); diff --git a/cpan/IO-Compress/t/000prereq.t b/cpan/IO-Compress/t/000prereq.t index f657083ad4..77a194d2c6 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.100'; + my $VERSION = '2.101'; my @NAMES = qw( Compress::Raw::Bzip2 Compress::Raw::Zlib diff --git a/cpan/IO-Compress/t/011-streamzip.t b/cpan/IO-Compress/t/011-streamzip.t index 181371a7c8..668177616f 100644 --- a/cpan/IO-Compress/t/011-streamzip.t +++ b/cpan/IO-Compress/t/011-streamzip.t @@ -25,7 +25,7 @@ BEGIN $extra = 1 if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 }; - plan tests => 8 + $extra ; + plan tests => 136 + $extra ; } @@ -104,15 +104,102 @@ sub check } { - title "streamzip" ; + title "streamzip - zipfile option" ; my ($infile, $outfile); my $lex = LexFile->new( $infile, $outfile ); writeFile($infile, $hello1) ; - check "$Perl ${binDir}/streamzip -zipfile=$outfile <$infile"; + check "$Perl ${binDir}/streamzip -zipfile $outfile <$infile"; my $uncompressed ; unzip $outfile => \$uncompressed; is $uncompressed, $hello1; } + +for my $method (qw(store deflate bzip2 lzma xz zstd)) +{ + SKIP: + { + if ($method eq 'lzma') + { + eval { require IO::Compress::Lzma } ; + skip "Method 'lzma' needs IO::Compress::Lzma\n", 8 + if $@; + } + + if ($method eq 'zstd') + { + eval { require IO::Compress::Zstd } ; + skip "Method 'zstd' needs IO::Compress::Zstd\n", 8 + if $@; + } + + if ($method eq 'xz') + { + eval { require IO::Compress::Xz } ; + skip "Method 'zstd' needs IO::Compress::Xz\n", 8 + if $@; + } + + { + title "streamzip method $method" ; + + my ($infile, $outfile); + my $lex = LexFile->new( $infile, $outfile ); + + writeFile($infile, $hello1) ; + check "$Perl ${binDir}/streamzip -method $method <$infile >$outfile"; + + my $uncompressed ; + unzip $outfile => \$uncompressed; + is $uncompressed, $hello1; + } + + { + title "streamzip $method- zipfile option" ; + + my ($infile, $outfile); + my $lex = LexFile->new( $infile, $outfile ); + + writeFile($infile, $hello1) ; + check "$Perl ${binDir}/streamzip -zipfile $outfile -method $method <$infile"; + + my $uncompressed ; + unzip $outfile => \$uncompressed; + is $uncompressed, $hello1; + } + } +} + +for my $level (0 ..9) +{ + { + title "streamzip level $level" ; + + my ($infile, $outfile); + my $lex = LexFile->new( $infile, $outfile ); + + writeFile($infile, $hello1) ; + check "$Perl ${binDir}/streamzip -$level <$infile >$outfile"; + + my $uncompressed ; + unzip $outfile => \$uncompressed; + is $uncompressed, $hello1; + } + + { + title "streamzip level $level- zipfile option" ; + + my ($infile, $outfile); + my $lex = LexFile->new( $infile, $outfile ); + + writeFile($infile, $hello1) ; + check "$Perl ${binDir}/streamzip -zipfile $outfile -$level <$infile"; + + my $uncompressed ; + unzip $outfile => \$uncompressed; + is $uncompressed, $hello1; + } + +} diff --git a/cpan/IO-Compress/t/compress/generic.pl b/cpan/IO-Compress/t/compress/generic.pl index 2c24bb85e5..935ae3a1ca 100644 --- a/cpan/IO-Compress/t/compress/generic.pl +++ b/cpan/IO-Compress/t/compress/generic.pl @@ -342,14 +342,19 @@ EOM is myGZreadFile($name), $hello, " wrote OK"; #hexDump($name); + SKIP: { title "Input from stdin via filename '-'"; + # Older versions of Windows can hang on these tests + skip 'Skipping STDIN tests', 5 + if $ENV{IO_COMPRESS_SKIP_STDIN_TESTS}; + my $x ; my $uncomp ; my $stdinFileno = fileno(STDIN); # open below doesn't return 1 sometimes on XP - open(SAVEIN, "<&STDIN"); + open(SAVEIN, "<&STDIN"); ok open(STDIN, "<$name"), " redirect STDIN"; my $dummy = fileno SAVEIN; $x = $UncompressClass->can('new')->( $UncompressClass, '-', Append => 1, Transparent => 0 ) @@ -360,7 +365,7 @@ EOM 1 while $x->read($uncomp) > 0 ; ok $x->close, " close" ; - open(STDIN, "<&SAVEIN"); + open(STDIN, "<&SAVEIN"); is $uncomp, $hello, " expected output" ; } } diff --git a/cpan/IO-Compress/t/compress/oneshot.pl b/cpan/IO-Compress/t/compress/oneshot.pl index 7e59fe58ed..b27c1f1878 100644 --- a/cpan/IO-Compress/t/compress/oneshot.pl +++ b/cpan/IO-Compress/t/compress/oneshot.pl @@ -491,13 +491,19 @@ sub run } + SKIP: { title "$TopType - From stdin (via '-') to Buffer content '$disp_content' Append $append" ; + # Older versions of Windows can hang on these tests + skip 'Skipping STDIN tests', 3 + $append + if $ENV{IO_COMPRESS_SKIP_STDIN_TESTS}; + my $lex = LexFile->new( my $in_file, my $out_file) ; writeFile($in_file, $buffer); - open(SAVEIN, "<&STDIN"); + open(SAVEIN, "<&STDIN"); + my $dummy = fileno SAVEIN ; ok open(STDIN, "<$in_file"), " redirect STDIN"; @@ -506,7 +512,7 @@ sub run ok &$Func('-', \$out, Append => $append), ' Compressed ok' or diag $$Error ; - open(STDIN, "<&SAVEIN"); + open(STDIN, "<&SAVEIN"); my $got = anyUncompress(\$out, $already); $got = undef if ! defined $buffer && $got eq '' ; @@ -1260,13 +1266,19 @@ sub run is $output, $expected, " Uncompressed matches original"; } + SKIP: { title "$TopType - From stdin (via '-') to Buffer content, Append($append) " ; + # Older versions of Windows can hang on these tests + skip 'Skipping STDIN tests', 4 + if $ENV{IO_COMPRESS_SKIP_STDIN_TESTS}; + my $lex = LexFile->new( my $in_file) ; writeFile($in_file, $comp); - open(SAVEIN, "<&STDIN"); + open(SAVEIN, "<&STDIN"); + my $dummy = fileno SAVEIN ; ok open(STDIN, "<$in_file"), " redirect STDIN"; @@ -1276,7 +1288,7 @@ sub run ok &$Func('-', \$output, Append => $append, @opts), ' Uncompressed ok' or diag $$Error ; - open(STDIN, "<&SAVEIN"); + open(STDIN, "<&SAVEIN"); is $keep_comp, $comp, " Input buffer not changed" ; is $output, $expected, " Uncompressed matches original"; @@ -1313,32 +1325,42 @@ sub run is $buff, $appended, " Appended data ok"; } - for my $stdin ('-', *STDIN) # , \*STDIN) + SKIP: { - title "$TopType - From stdin (via $stdin) to Buffer content, InputLength" ; - my $lex = LexFile->new( my $in_file ); - my $expected = $buffer ; - my $appended = 'appended'; - my $len_appended = length $appended; - writeFile($in_file, $comp . $appended ) ; + # Older versions of Windows can hang on these tests + skip 'Skipping STDIN tests', 12 + if $ENV{IO_COMPRESS_SKIP_STDIN_TESTS}; - open(SAVEIN, "<&STDIN"); - my $dummy = fileno SAVEIN ; - ok open(STDIN, "<$in_file"), " redirect STDIN"; + for my $stdin ('-', *STDIN) # , \*STDIN) + { + title "$TopType - From stdin (via $stdin) to Buffer content, InputLength" ; - my $output ; - ok &$Func($stdin, \$output, Transparent => 0, InputLength => length $comp, @opts), ' Uncompressed ok' - or diag $$Error ; - my $buff ; - is read(STDIN, $buff, $len_appended), $len_appended, " Length of Appended data ok"; + my $lex = LexFile->new( my $in_file ); + my $expected = $buffer ; + my $appended = 'appended'; + my $len_appended = length $appended; + writeFile($in_file, $comp . $appended ) ; - is $output, $expected, " Uncompressed matches original"; - is $buff, $appended, " Appended data ok"; + open(SAVEIN, "<&STDIN"); + my $dummy = fileno SAVEIN ; + ok open(STDIN, "<$in_file"), " redirect STDIN"; + + my $output ; + + ok &$Func($stdin, \$output, Transparent => 0, InputLength => length $comp, @opts), ' Uncompressed ok' + or diag $$Error ; + + my $buff ; + is read(STDIN, $buff, $len_appended), $len_appended, " Length of Appended data ok"; + + is $output, $expected, " Uncompressed matches original"; + is $buff, $appended, " Appended data ok"; - open(STDIN, "<&SAVEIN"); + open(STDIN, "<&SAVEIN"); + } } } @@ -1647,6 +1669,7 @@ sub run skip "open filehandle to buffer not supported in Perl $]", 7 if $] < 5.008 ; + my $CompFunc = getTopFuncRef($CompressClass); my $UncompFunc = getTopFuncRef($UncompressClass); |