diff options
34 files changed, 270 insertions, 245 deletions
diff --git a/cpan/IO-Compress/Makefile.PL b/cpan/IO-Compress/Makefile.PL index 8e9acfe7cf..e9d20a412b 100644 --- a/cpan/IO-Compress/Makefile.PL +++ b/cpan/IO-Compress/Makefile.PL @@ -3,8 +3,8 @@ use strict ; require 5.006 ; -$::VERSION = '2.106' ; -$::DEP_VERSION = '2.103'; +$::VERSION = '2.201' ; +$::DEP_VERSION = '2.201'; use lib '.'; use private::MakeUtil; @@ -29,6 +29,7 @@ WriteMakefile( 'Compress::Raw::Zlib' => $::DEP_VERSION, 'Scalar::Util' => 0, 'Encode' => 0, + 'Time::Local' => 0, $] >= 5.005 && $] < 5.006 ? ('File::BSDGlob' => 0) : () } diff --git a/cpan/IO-Compress/bin/streamzip b/cpan/IO-Compress/bin/streamzip index d0f92fb620..199599ee38 100644 --- a/cpan/IO-Compress/bin/streamzip +++ b/cpan/IO-Compress/bin/streamzip @@ -12,7 +12,7 @@ use IO::Compress::Zip qw(zip use Getopt::Long; -my $VERSION = '1.002'; +my $VERSION = '1.00'; my $compression_method = ZIP_CM_DEFLATE; my $stream = 0; @@ -51,6 +51,10 @@ if ($compression_method == ZIP_CM_DEFLATE && defined $level) push @extraOpts, (Level => $level) } +# force streaming zip file when writing to stdout. +$stream = 1 + if $zipfile eq '-'; + zip '-' => $zipfile, Name => $memberName, Zip64 => $zip64, @@ -107,7 +111,8 @@ Usage: producer | streamzip [OPTIONS] | consumer producer | streamzip [OPTIONS] -zipfile output.zip -Stream data from stdin, compress into a Zip container, and stream to stdout. +Stream data from stdin, compress into a Zip container, and either stream to stdout, or +write to a named file. OPTIONS @@ -131,7 +136,7 @@ OPTIONS zstd Use LZMA compression [needs IO::Compress::Zstd] -version Display version number [$VERSION] -Copyright (c) 2019-2021 Paul Marquess. All rights reserved. +Copyright (c) 2019-2022 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. @@ -287,7 +292,7 @@ Paul Marquess F<pmqs@cpan.org>. =head1 COPYRIGHT -Copyright (c) 2019-2021 Paul Marquess. All rights reserved. +Copyright (c) 2019-2022 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 37aa051557..59dfbf6d1b 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.106 ; -use Compress::Raw::Zlib 2.103 ; -use IO::Compress::Gzip 2.106 ; -use IO::Uncompress::Gunzip 2.106 ; +use IO::Compress::Base::Common 2.201 ; +use Compress::Raw::Zlib 2.201 ; +use IO::Compress::Gzip 2.201 ; +use IO::Uncompress::Gunzip 2.201 ; use strict ; use warnings ; use bytes ; our ($VERSION, $XS_VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); -$VERSION = '2.106'; +$VERSION = '2.201'; $XS_VERSION = $VERSION; $VERSION = eval $VERSION; @@ -461,7 +461,7 @@ sub inflate package Compress::Zlib ; -use IO::Compress::Gzip::Constants 2.106 ; +use IO::Compress::Gzip::Constants 2.201 ; sub memGzip($) { @@ -1494,6 +1494,9 @@ C<gzip@prep.ai.mit.edu> and Mark Adler C<madler@alumni.caltech.edu>. The primary site for the I<zlib> compression library is L<http://www.zlib.org>. +The primary site for the I<zlib-ng> compression library is +L<https://github.com/zlib-ng/zlib-ng>. + The primary site for gzip is L<http://www.gzip.org>. =head1 AUTHOR diff --git a/cpan/IO-Compress/lib/IO/Compress/Adapter/Bzip2.pm b/cpan/IO-Compress/lib/IO/Compress/Adapter/Bzip2.pm index cc1700aab2..3ff2b4f57f 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.106 qw(:Status); +use IO::Compress::Base::Common 2.201 qw(:Status); -use Compress::Raw::Bzip2 2.103 ; +use Compress::Raw::Bzip2 2.201 ; our ($VERSION); -$VERSION = '2.106'; +$VERSION = '2.201'; 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 12f97ccc52..08555e9441 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.106 qw(:Status); -use Compress::Raw::Zlib 2.103 qw( !crc32 !adler32 ) ; +use IO::Compress::Base::Common 2.201 qw(:Status); +use Compress::Raw::Zlib 2.201 qw( !crc32 !adler32 ) ; require Exporter; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, @EXPORT, %DEFLATE_CONSTANTS); -$VERSION = '2.106'; +$VERSION = '2.201'; @ISA = qw(Exporter); @EXPORT_OK = @Compress::Raw::Zlib::DEFLATE_CONSTANTS; %EXPORT_TAGS = %Compress::Raw::Zlib::DEFLATE_CONSTANTS; @@ -40,6 +40,29 @@ sub mkCompObject } ; } +sub mkCompObject1 +{ + my $crc32 = shift ; + my $adler32 = shift ; + my $level = shift ; + my $strategy = shift ; + + my ($def, $status) = Compress::Raw::Zlib::Deflate->new( + -AppendOutput => 1, + -CRC32 => $crc32, + -ADLER32 => $adler32, + -Level => $level, + -Strategy => $strategy, + -WindowBits => MAX_WBITS); + + return (undef, "Cannot create Deflate object: $status", $status) + if $status != Z_OK; + + return bless {'Def' => $def, + 'Error' => '', + } ; +} + sub compr { my $self = shift ; diff --git a/cpan/IO-Compress/lib/IO/Compress/Adapter/Identity.pm b/cpan/IO-Compress/lib/IO/Compress/Adapter/Identity.pm index a21962ea1a..99263d02a7 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.106 qw(:Status); +use IO::Compress::Base::Common 2.201 qw(:Status); our ($VERSION); -$VERSION = '2.106'; +$VERSION = '2.201'; sub mkCompObject { diff --git a/cpan/IO-Compress/lib/IO/Compress/Base.pm b/cpan/IO-Compress/lib/IO/Compress/Base.pm index fdb169d771..8941c271cd 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.106 ; +use IO::Compress::Base::Common 2.201 ; use IO::File (); ; use Scalar::Util (); @@ -20,7 +20,7 @@ use Symbol(); our (@ISA, $VERSION); @ISA = qw(IO::File Exporter); -$VERSION = '2.106'; +$VERSION = '2.201'; #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 39ac016858..7374ce4577 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.106'; +$VERSION = '2.201'; @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 faf043b154..7c18059d84 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.106 ; +use IO::Compress::Base 2.201 ; -use IO::Compress::Base::Common 2.106 qw(); -use IO::Compress::Adapter::Bzip2 2.106 ; +use IO::Compress::Base::Common 2.201 qw(); +use IO::Compress::Adapter::Bzip2 2.201 ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $Bzip2Error); -$VERSION = '2.106'; +$VERSION = '2.201'; $Bzip2Error = ''; @ISA = qw(IO::Compress::Base Exporter); @@ -51,7 +51,7 @@ sub getExtraParams { my $self = shift ; - use IO::Compress::Base::Common 2.106 qw(:Parse); + use IO::Compress::Base::Common 2.201 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 0998952b4d..4f239ed34f 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.106 (); -use IO::Compress::Adapter::Deflate 2.106 ; +use IO::Compress::RawDeflate 2.201 (); +use IO::Compress::Adapter::Deflate 2.201 ; -use IO::Compress::Zlib::Constants 2.106 ; -use IO::Compress::Base::Common 2.106 qw(); +use IO::Compress::Zlib::Constants 2.201 ; +use IO::Compress::Base::Common 2.201 qw(); our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $DeflateError); -$VERSION = '2.106'; +$VERSION = '2.201'; $DeflateError = ''; @ISA = qw(IO::Compress::RawDeflate Exporter); @@ -42,92 +42,35 @@ sub deflate return $obj->_def(@_); } - -sub bitmask($$$$) -{ - my $into = shift ; - my $value = shift ; - my $offset = shift ; - my $mask = shift ; - - return $into | (($value & $mask) << $offset ) ; -} - -sub mkDeflateHdr($$$;$) -{ - my $method = shift ; - my $cinfo = shift; - my $level = shift; - my $fdict_adler = shift ; - - my $cmf = 0; - my $flg = 0; - my $fdict = 0; - $fdict = 1 if defined $fdict_adler; - - $cmf = bitmask($cmf, $method, ZLIB_CMF_CM_OFFSET, ZLIB_CMF_CM_BITS); - $cmf = bitmask($cmf, $cinfo, ZLIB_CMF_CINFO_OFFSET, ZLIB_CMF_CINFO_BITS); - - $flg = bitmask($flg, $fdict, ZLIB_FLG_FDICT_OFFSET, ZLIB_FLG_FDICT_BITS); - $flg = bitmask($flg, $level, ZLIB_FLG_LEVEL_OFFSET, ZLIB_FLG_LEVEL_BITS); - - my $fcheck = 31 - ($cmf * 256 + $flg) % 31 ; - $flg = bitmask($flg, $fcheck, ZLIB_FLG_FCHECK_OFFSET, ZLIB_FLG_FCHECK_BITS); - - my $hdr = pack("CC", $cmf, $flg) ; - $hdr .= pack("N", $fdict_adler) if $fdict ; - - return $hdr; -} - -sub mkHeader +sub mkComp { my $self = shift ; - my $param = shift ; + my $got = shift ; - my $level = $param->getValue('level'); - my $strategy = $param->getValue('strategy'); + my ($obj, $errstr, $errno) = IO::Compress::Adapter::Deflate::mkCompObject1( + $got->getValue('crc32'), + $got->getValue('adler32'), + $got->getValue('level'), + $got->getValue('strategy') + ); - my $lflag ; - $level = 6 - if $level == Z_DEFAULT_COMPRESSION ; + return $self->saveErrorString(undef, $errstr, $errno) + if ! defined $obj; - if (ZLIB_VERNUM >= 0x1210) - { - if ($strategy >= Z_HUFFMAN_ONLY || $level < 2) - { $lflag = ZLIB_FLG_LEVEL_FASTEST } - elsif ($level < 6) - { $lflag = ZLIB_FLG_LEVEL_FAST } - elsif ($level == 6) - { $lflag = ZLIB_FLG_LEVEL_DEFAULT } - else - { $lflag = ZLIB_FLG_LEVEL_SLOWEST } - } - else - { - $lflag = ($level - 1) >> 1 ; - $lflag = 3 if $lflag > 3 ; - } - - #my $wbits = (MAX_WBITS - 8) << 4 ; - my $wbits = 7; - mkDeflateHdr(ZLIB_CMF_CM_DEFLATED, $wbits, $lflag); + return $obj; } -sub ckParams + +sub mkHeader { my $self = shift ; - my $got = shift; - - $got->setValue('adler32' => 1); - return 1 ; + return ''; } - sub mkTrailer { my $self = shift ; - return pack("N", *$self->{Compress}->adler32()) ; + return ''; } sub mkFinalTrailer @@ -135,12 +78,6 @@ sub mkFinalTrailer return ''; } -#sub newHeader -#{ -# my $self = shift ; -# return *$self->{Header}; -#} - sub getExtraParams { my $self = shift ; @@ -940,6 +877,9 @@ C<gzip@prep.ai.mit.edu> and Mark Adler C<madler@alumni.caltech.edu>. The primary site for the I<zlib> compression library is L<http://www.zlib.org>. +The primary site for the I<zlib-ng> compression library is +L<https://github.com/zlib-ng/zlib-ng>. + The primary site for gzip is L<http://www.gzip.org>. =head1 AUTHOR diff --git a/cpan/IO-Compress/lib/IO/Compress/Gzip.pm b/cpan/IO-Compress/lib/IO/Compress/Gzip.pm index 0471e33ea7..e81106692e 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.106 () ; -use IO::Compress::Adapter::Deflate 2.106 ; +use IO::Compress::RawDeflate 2.201 () ; +use IO::Compress::Adapter::Deflate 2.201 ; -use IO::Compress::Base::Common 2.106 qw(:Status ); -use IO::Compress::Gzip::Constants 2.106 ; -use IO::Compress::Zlib::Extra 2.106 ; +use IO::Compress::Base::Common 2.201 qw(:Status ); +use IO::Compress::Gzip::Constants 2.201 ; +use IO::Compress::Zlib::Extra 2.201 ; BEGIN { @@ -25,7 +25,7 @@ BEGIN our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $GzipError); -$VERSION = '2.106'; +$VERSION = '2.201'; $GzipError = '' ; @ISA = qw(IO::Compress::RawDeflate Exporter); @@ -1252,6 +1252,9 @@ C<gzip@prep.ai.mit.edu> and Mark Adler C<madler@alumni.caltech.edu>. The primary site for the I<zlib> compression library is L<http://www.zlib.org>. +The primary site for the I<zlib-ng> compression library is +L<https://github.com/zlib-ng/zlib-ng>. + The primary site for gzip is L<http://www.gzip.org>. =head1 AUTHOR diff --git a/cpan/IO-Compress/lib/IO/Compress/Gzip/Constants.pm b/cpan/IO-Compress/lib/IO/Compress/Gzip/Constants.pm index 8e32e17d59..c9c6866e73 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.106'; +$VERSION = '2.201'; @ISA = qw(Exporter); diff --git a/cpan/IO-Compress/lib/IO/Compress/RawDeflate.pm b/cpan/IO-Compress/lib/IO/Compress/RawDeflate.pm index de0f332ecb..ee9079989a 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.106 ; -use IO::Compress::Base::Common 2.106 qw(:Status :Parse); -use IO::Compress::Adapter::Deflate 2.106 ; -use Compress::Raw::Zlib 2.103 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY); +use IO::Compress::Base 2.201 ; +use IO::Compress::Base::Common 2.201 qw(:Status :Parse); +use IO::Compress::Adapter::Deflate 2.201 ; +use Compress::Raw::Zlib 2.201 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY); require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %DEFLATE_CONSTANTS, %EXPORT_TAGS, $RawDeflateError); -$VERSION = '2.106'; +$VERSION = '2.201'; $RawDeflateError = ''; @ISA = qw(IO::Compress::Base Exporter); @@ -995,6 +995,9 @@ C<gzip@prep.ai.mit.edu> and Mark Adler C<madler@alumni.caltech.edu>. The primary site for the I<zlib> compression library is L<http://www.zlib.org>. +The primary site for the I<zlib-ng> compression library is +L<https://github.com/zlib-ng/zlib-ng>. + The primary site for gzip is L<http://www.gzip.org>. =head1 AUTHOR diff --git a/cpan/IO-Compress/lib/IO/Compress/Zip.pm b/cpan/IO-Compress/lib/IO/Compress/Zip.pm index ecba767727..0f33e7b82a 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.106 qw(:Status ); -use IO::Compress::RawDeflate 2.106 (); -use IO::Compress::Adapter::Deflate 2.106 ; -use IO::Compress::Adapter::Identity 2.106 ; -use IO::Compress::Zlib::Extra 2.106 ; -use IO::Compress::Zip::Constants 2.106 ; +use IO::Compress::Base::Common 2.201 qw(:Status ); +use IO::Compress::RawDeflate 2.201 (); +use IO::Compress::Adapter::Deflate 2.201 ; +use IO::Compress::Adapter::Identity 2.201 ; +use IO::Compress::Zlib::Extra 2.201 ; +use IO::Compress::Zip::Constants 2.201 ; use File::Spec(); use Config; -use Compress::Raw::Zlib 2.103 (); +use Compress::Raw::Zlib 2.201 (); BEGIN { eval { require IO::Compress::Adapter::Bzip2 ; - IO::Compress::Adapter::Bzip2->import( 2.103 ); + IO::Compress::Adapter::Bzip2->import( 2.201 ); require IO::Compress::Bzip2 ; - IO::Compress::Bzip2->import( 2.103 ); + IO::Compress::Bzip2->import( 2.201 ); } ; eval { require IO::Compress::Adapter::Lzma ; - IO::Compress::Adapter::Lzma->import( 2.103 ); + IO::Compress::Adapter::Lzma->import( 2.201 ); require IO::Compress::Lzma ; - IO::Compress::Lzma->import( 2.103 ); + IO::Compress::Lzma->import( 2.201 ); } ; eval { require IO::Compress::Adapter::Xz ; - IO::Compress::Adapter::Xz->import( 2.103 ); + IO::Compress::Adapter::Xz->import( 2.201 ); require IO::Compress::Xz ; - IO::Compress::Xz->import( 2.103 ); + IO::Compress::Xz->import( 2.201 ); } ; eval { require IO::Compress::Adapter::Zstd ; - IO::Compress::Adapter::Zstd->import( 2.103 ); + IO::Compress::Adapter::Zstd->import( 2.201 ); require IO::Compress::Zstd ; - IO::Compress::Zstd->import( 2.103 ); + IO::Compress::Zstd->import( 2.201 ); } ; } @@ -47,7 +47,7 @@ require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $ZipError); -$VERSION = '2.106'; +$VERSION = '2.201'; $ZipError = ''; @ISA = qw(IO::Compress::RawDeflate Exporter); @@ -85,20 +85,24 @@ sub isMethodAvailable if $method == ZIP_CM_STORE || $method == ZIP_CM_DEFLATE ; return 1 - if $method == ZIP_CM_BZIP2 and - defined $IO::Compress::Adapter::Bzip2::VERSION; + if $method == ZIP_CM_BZIP2 && + defined $IO::Compress::Adapter::Bzip2::VERSION && + defined &{ "IO::Compress::Adapter::Bzip2::mkRawZipCompObject" }; return 1 - if $method == ZIP_CM_LZMA and - defined $IO::Compress::Adapter::Lzma::VERSION; + if $method == ZIP_CM_LZMA && + defined $IO::Compress::Adapter::Lzma::VERSION && + defined &{ "IO::Compress::Adapter::Lzma::mkRawZipCompObject" }; return 1 - if $method == ZIP_CM_XZ and - defined $IO::Compress::Adapter::Xz::VERSION; + if $method == ZIP_CM_XZ && + defined $IO::Compress::Adapter::Xz::VERSION && + defined &{ "IO::Compress::Adapter::Xz::mkRawZipCompObject" }; return 1 - if $method == ZIP_CM_ZSTD and - defined $IO::Compress::Adapter::ZSTD::VERSION; + if $method == ZIP_CM_ZSTD && + defined $IO::Compress::Adapter::ZSTD::VERSION && + defined &{ "IO::Compress::Adapter::ZSTD::mkRawZipCompObject" }; return 0; } @@ -1053,12 +1057,24 @@ See L<File::GlobMapper|File::GlobMapper> for more details. If the C<$input_filename_or_reference> parameter is any other type, C<undef> will be returned. -In addition, if C<$input_filename_or_reference> is a simple filename, -the default values for -the C<Name>, C<Time>, C<TextFlag>, C<ExtAttr>, C<exUnixN> and C<exTime> options will be sourced from that file. +In addition, if C<$input_filename_or_reference> corresponds to a filename +from the filesystem, a number of zip file header fields will be populated by default +using the following attributes from the input file + +=over 5 + +=item * the full filename contained in C<$input_filename_or_reference> + +=item * the file protection attributes + +=item * the UID/GID for the file + +=item * the file timestamps + +=back If you do not want to use these defaults they can be overridden by -explicitly setting the C<Name>, C<Time>, C<TextFlag>, C<ExtAttr>, C<exUnixN> and C<exTime> options or by setting the +explicitly setting one, or more, of the C<Name>, C<Time>, C<TextFlag>, C<ExtAttr>, C<exUnixN> and C<exTime> options or by setting the C<Minimal> parameter. =head3 The C<$output_filename_or_reference> parameter @@ -2131,6 +2147,9 @@ C<gzip@prep.ai.mit.edu> and Mark Adler C<madler@alumni.caltech.edu>. The primary site for the I<zlib> compression library is L<http://www.zlib.org>. +The primary site for the I<zlib-ng> compression library is +L<https://github.com/zlib-ng/zlib-ng>. + The primary site for gzip is L<http://www.gzip.org>. =head1 AUTHOR diff --git a/cpan/IO-Compress/lib/IO/Compress/Zip/Constants.pm b/cpan/IO-Compress/lib/IO/Compress/Zip/Constants.pm index 7cfe431932..dfb3611b54 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.106'; +$VERSION = '2.201'; @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 1d1dab5018..11181181bf 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.106'; +$VERSION = '2.201'; @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 24204fafa3..c034ed554e 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.106'; +$VERSION = '2.201'; -use IO::Compress::Gzip::Constants 2.106 ; +use IO::Compress::Gzip::Constants 2.201 ; 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 0d0707b34a..f020a32450 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.106 qw(:Status); +use IO::Compress::Base::Common 2.201 qw(:Status); -use Compress::Raw::Bzip2 2.103 ; +use Compress::Raw::Bzip2 2.201 ; our ($VERSION, @ISA); -$VERSION = '2.106'; +$VERSION = '2.201'; 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 dd12483615..0ec0ecc53a 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.106 qw(:Status); +use IO::Compress::Base::Common 2.201 qw(:Status); use IO::Compress::Zip::Constants ; our ($VERSION); -$VERSION = '2.106'; +$VERSION = '2.201'; -use Compress::Raw::Zlib 2.103 (); +use Compress::Raw::Zlib 2.201 (); 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 05f6de2ea0..d23e06d24d 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.106 qw(:Status); -use Compress::Raw::Zlib 2.103 qw(Z_OK Z_BUF_ERROR Z_STREAM_END Z_FINISH MAX_WBITS); +use IO::Compress::Base::Common 2.201 qw(:Status); +use Compress::Raw::Zlib 2.201 qw(Z_OK Z_BUF_ERROR Z_STREAM_END Z_FINISH MAX_WBITS); our ($VERSION); -$VERSION = '2.106'; +$VERSION = '2.201'; diff --git a/cpan/IO-Compress/lib/IO/Uncompress/AnyInflate.pm b/cpan/IO-Compress/lib/IO/Uncompress/AnyInflate.pm index 4d99439a57..fb96d8936c 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.106 qw(:Parse); +use IO::Compress::Base::Common 2.201 qw(:Parse); -use IO::Uncompress::Adapter::Inflate 2.106 (); +use IO::Uncompress::Adapter::Inflate 2.201 (); -use IO::Uncompress::Base 2.106 ; -use IO::Uncompress::Gunzip 2.106 ; -use IO::Uncompress::Inflate 2.106 ; -use IO::Uncompress::RawInflate 2.106 ; -use IO::Uncompress::Unzip 2.106 ; +use IO::Uncompress::Base 2.201 ; +use IO::Uncompress::Gunzip 2.201 ; +use IO::Uncompress::Inflate 2.201 ; +use IO::Uncompress::RawInflate 2.201 ; +use IO::Uncompress::Unzip 2.201 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $AnyInflateError); -$VERSION = '2.106'; +$VERSION = '2.201'; $AnyInflateError = ''; @ISA = qw(IO::Uncompress::Base Exporter); @@ -986,6 +986,9 @@ C<gzip@prep.ai.mit.edu> and Mark Adler C<madler@alumni.caltech.edu>. The primary site for the I<zlib> compression library is L<http://www.zlib.org>. +The primary site for the I<zlib-ng> compression library is +L<https://github.com/zlib-ng/zlib-ng>. + The primary site for gzip is L<http://www.gzip.org>. =head1 AUTHOR diff --git a/cpan/IO-Compress/lib/IO/Uncompress/AnyUncompress.pm b/cpan/IO-Compress/lib/IO/Uncompress/AnyUncompress.pm index ed192ca38e..8f0edd48c2 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.106 (); +use IO::Compress::Base::Common 2.201 (); -use IO::Uncompress::Base 2.106 ; +use IO::Uncompress::Base 2.201 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $AnyUncompressError); -$VERSION = '2.106'; +$VERSION = '2.201'; $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.103 ;'; - eval ' use IO::Uncompress::Adapter::Bunzip2 2.103 ;'; - eval ' use IO::Uncompress::Adapter::LZO 2.103 ;'; - eval ' use IO::Uncompress::Adapter::Lzf 2.103 ;'; - eval ' use IO::Uncompress::Adapter::UnLzma 2.103 ;'; - eval ' use IO::Uncompress::Adapter::UnXz 2.103 ;'; - eval ' use IO::Uncompress::Adapter::UnZstd 2.103 ;'; - eval ' use IO::Uncompress::Adapter::UnLzip 2.103 ;'; - - eval ' use IO::Uncompress::Bunzip2 2.103 ;'; - eval ' use IO::Uncompress::UnLzop 2.103 ;'; - eval ' use IO::Uncompress::Gunzip 2.103 ;'; - eval ' use IO::Uncompress::Inflate 2.103 ;'; - eval ' use IO::Uncompress::RawInflate 2.103 ;'; - eval ' use IO::Uncompress::Unzip 2.103 ;'; - eval ' use IO::Uncompress::UnLzf 2.103 ;'; - eval ' use IO::Uncompress::UnLzma 2.103 ;'; - eval ' use IO::Uncompress::UnXz 2.103 ;'; - eval ' use IO::Uncompress::UnZstd 2.103 ;'; - eval ' use IO::Uncompress::UnLzip 2.103 ;'; + eval ' use IO::Uncompress::Adapter::Inflate 2.201 ;'; + eval ' use IO::Uncompress::Adapter::Bunzip2 2.201 ;'; + eval ' use IO::Uncompress::Adapter::LZO 2.201 ;'; + eval ' use IO::Uncompress::Adapter::Lzf 2.201 ;'; + eval ' use IO::Uncompress::Adapter::UnLzma 2.201 ;'; + eval ' use IO::Uncompress::Adapter::UnXz 2.201 ;'; + eval ' use IO::Uncompress::Adapter::UnZstd 2.201 ;'; + eval ' use IO::Uncompress::Adapter::UnLzip 2.201 ;'; + + eval ' use IO::Uncompress::Bunzip2 2.201 ;'; + eval ' use IO::Uncompress::UnLzop 2.201 ;'; + eval ' use IO::Uncompress::Gunzip 2.201 ;'; + eval ' use IO::Uncompress::Inflate 2.201 ;'; + eval ' use IO::Uncompress::RawInflate 2.201 ;'; + eval ' use IO::Uncompress::Unzip 2.201 ;'; + eval ' use IO::Uncompress::UnLzf 2.201 ;'; + eval ' use IO::Uncompress::UnLzma 2.201 ;'; + eval ' use IO::Uncompress::UnXz 2.201 ;'; + eval ' use IO::Uncompress::UnZstd 2.201 ;'; + eval ' use IO::Uncompress::UnLzip 2.201 ;'; } diff --git a/cpan/IO-Compress/lib/IO/Uncompress/Base.pm b/cpan/IO-Compress/lib/IO/Uncompress/Base.pm index a922a5be8a..eeca15f9b5 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.106'; +$VERSION = '2.201'; use constant G_EOF => 0 ; use constant G_ERR => -1 ; -use IO::Compress::Base::Common 2.106 ; +use IO::Compress::Base::Common 2.201 ; 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 e72b36fbbc..5230cf75de 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.106 qw(:Status ); +use IO::Compress::Base::Common 2.201 qw(:Status ); -use IO::Uncompress::Base 2.106 ; -use IO::Uncompress::Adapter::Bunzip2 2.106 ; +use IO::Uncompress::Base 2.201 ; +use IO::Uncompress::Adapter::Bunzip2 2.201 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $Bunzip2Error); -$VERSION = '2.106'; +$VERSION = '2.201'; $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 b7d4ae54d3..6500fc358d 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.106 ; +use IO::Uncompress::RawInflate 2.201 ; -use Compress::Raw::Zlib 2.103 () ; -use IO::Compress::Base::Common 2.106 qw(:Status ); -use IO::Compress::Gzip::Constants 2.106 ; -use IO::Compress::Zlib::Extra 2.106 ; +use Compress::Raw::Zlib 2.201 () ; +use IO::Compress::Base::Common 2.201 qw(:Status ); +use IO::Compress::Gzip::Constants 2.201 ; +use IO::Compress::Zlib::Extra 2.201 ; require Exporter ; @@ -28,7 +28,7 @@ Exporter::export_ok_tags('all'); $GunzipError = ''; -$VERSION = '2.106'; +$VERSION = '2.201'; sub new { @@ -1110,6 +1110,9 @@ C<gzip@prep.ai.mit.edu> and Mark Adler C<madler@alumni.caltech.edu>. The primary site for the I<zlib> compression library is L<http://www.zlib.org>. +The primary site for the I<zlib-ng> compression library is +L<https://github.com/zlib-ng/zlib-ng>. + The primary site for gzip is L<http://www.gzip.org>. =head1 AUTHOR diff --git a/cpan/IO-Compress/lib/IO/Uncompress/Inflate.pm b/cpan/IO-Compress/lib/IO/Uncompress/Inflate.pm index d762364683..d7d848a6f8 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.106 qw(:Status ); -use IO::Compress::Zlib::Constants 2.106 ; +use IO::Compress::Base::Common 2.201 qw(:Status ); +use IO::Compress::Zlib::Constants 2.201 ; -use IO::Uncompress::RawInflate 2.106 ; +use IO::Uncompress::RawInflate 2.201 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $InflateError); -$VERSION = '2.106'; +$VERSION = '2.201'; $InflateError = ''; @ISA = qw(IO::Uncompress::RawInflate Exporter); @@ -982,6 +982,9 @@ C<gzip@prep.ai.mit.edu> and Mark Adler C<madler@alumni.caltech.edu>. The primary site for the I<zlib> compression library is L<http://www.zlib.org>. +The primary site for the I<zlib-ng> compression library is +L<https://github.com/zlib-ng/zlib-ng>. + The primary site for gzip is L<http://www.gzip.org>. =head1 AUTHOR diff --git a/cpan/IO-Compress/lib/IO/Uncompress/RawInflate.pm b/cpan/IO-Compress/lib/IO/Uncompress/RawInflate.pm index 6e957f3329..80abfeac63 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.103 ; -use IO::Compress::Base::Common 2.106 qw(:Status ); +use Compress::Raw::Zlib 2.201 ; +use IO::Compress::Base::Common 2.201 qw(:Status ); -use IO::Uncompress::Base 2.106 ; -use IO::Uncompress::Adapter::Inflate 2.106 ; +use IO::Uncompress::Base 2.201 ; +use IO::Uncompress::Adapter::Inflate 2.201 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $RawInflateError); -$VERSION = '2.106'; +$VERSION = '2.201'; $RawInflateError = ''; @ISA = qw(IO::Uncompress::Base Exporter); @@ -1110,6 +1110,9 @@ C<gzip@prep.ai.mit.edu> and Mark Adler C<madler@alumni.caltech.edu>. The primary site for the I<zlib> compression library is L<http://www.zlib.org>. +The primary site for the I<zlib-ng> compression library is +L<https://github.com/zlib-ng/zlib-ng>. + The primary site for gzip is L<http://www.gzip.org>. =head1 AUTHOR diff --git a/cpan/IO-Compress/lib/IO/Uncompress/Unzip.pm b/cpan/IO-Compress/lib/IO/Uncompress/Unzip.pm index cfe56d3cd5..e689c3214d 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.106 ; -use IO::Compress::Base::Common 2.106 qw(:Status ); -use IO::Uncompress::Adapter::Inflate 2.106 ; -use IO::Uncompress::Adapter::Identity 2.106 ; -use IO::Compress::Zlib::Extra 2.106 ; -use IO::Compress::Zip::Constants 2.106 ; +use IO::Uncompress::RawInflate 2.201 ; +use IO::Compress::Base::Common 2.201 qw(:Status ); +use IO::Uncompress::Adapter::Inflate 2.201 ; +use IO::Uncompress::Adapter::Identity 2.201 ; +use IO::Compress::Zlib::Extra 2.201 ; +use IO::Compress::Zip::Constants 2.201 ; -use Compress::Raw::Zlib 2.103 () ; +use Compress::Raw::Zlib 2.201 () ; BEGIN { @@ -38,7 +38,7 @@ require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $UnzipError, %headerLookup); -$VERSION = '2.106'; +$VERSION = '2.201'; $UnzipError = ''; @ISA = qw(IO::Uncompress::RawInflate Exporter); @@ -812,12 +812,11 @@ sub _dosToUnixTime my $min = ( ( $dt >> 5 ) & 0x3f ); my $sec = ( ( $dt << 1 ) & 0x3e ); - - use POSIX 'mktime'; - - my $time_t = mktime( $sec, $min, $hour, $mday, $mon, $year, 0, 0, -1 ); + use Time::Local ; + my $time_t = Time::Local::timelocal( $sec, $min, $hour, $mday, $mon, $year); return 0 if ! defined $time_t; - return $time_t; + return $time_t; + } #sub scanCentralDirectory @@ -1953,6 +1952,9 @@ C<gzip@prep.ai.mit.edu> and Mark Adler C<madler@alumni.caltech.edu>. The primary site for the I<zlib> compression library is L<http://www.zlib.org>. +The primary site for the I<zlib-ng> compression library is +L<https://github.com/zlib-ng/zlib-ng>. + The primary site for gzip is L<http://www.gzip.org>. =head1 AUTHOR diff --git a/cpan/IO-Compress/t/000prereq.t b/cpan/IO-Compress/t/000prereq.t index a7fe036f59..79a773f0cc 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.103'; + my $VERSION = '2.201'; my @NAMES = qw( Compress::Raw::Bzip2 Compress::Raw::Zlib @@ -86,9 +86,9 @@ BEGIN } } - # need zlib 1.2.0 or better + # need zlib 1.2.0 or better or zlib-ng - cmp_ok Compress::Raw::Zlib::ZLIB_VERNUM(), ">=", 0x1200 + ok Compress::Raw::Zlib::is_zlibng() || Compress::Raw::Zlib::ZLIB_VERNUM() >= 0x1200 or diag "IO::Compress needs zlib 1.2.0 or better, you have " . Compress::Raw::Zlib::zlib_version(); use_ok('Scalar::Util') ; diff --git a/cpan/IO-Compress/t/005defhdr.t b/cpan/IO-Compress/t/005defhdr.t index 8d4d16310f..91a4a9dabe 100644 --- a/cpan/IO-Compress/t/005defhdr.t +++ b/cpan/IO-Compress/t/005defhdr.t @@ -19,7 +19,7 @@ BEGIN { $extra = 1 if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 }; - plan tests => 595 + $extra ; + plan tests => 114 + $extra ; use_ok('Compress::Raw::Zlib') ; @@ -123,6 +123,7 @@ EOM } +if (0) # disable these tests: IO::Compress::Deflate doesn't create the zlib header itself so no need to test { title "Check user-defined header settings match zlib" ; @@ -168,13 +169,16 @@ EOM my $hdr1 = ReadHeaderInfoZlib($string, %$opts); + # zlib-ng <= 2.0.6 with Level 1 sets the CINFO value to 5 . All other zlib & zlib-ng use expected value of 7 + # Note that zlib-ng 2.0.x uses a 16-bit encoding for ZLIBNG_VERNUM + my $cinfoValue = Compress::Raw::Zlib::is_zlibng() && Compress::Raw::Zlib::ZLIBNG_VERNUM() <= 0x2060 && defined $opts->{'-Level'} && $opts->{'-Level'} == 1 ? 5 : 7; is $hdr->{CM}, 8, " CM is 8"; - is $hdr->{CINFO}, 7, " CINFO is 7"; + is $hdr->{CINFO}, $cinfoValue, " CINFO is $cinfoValue"; is $hdr->{FDICT}, 0, " FDICT is 0"; while (my ($k, $v) = each %$expect) { - if (ZLIB_VERNUM >= 0x1220) + if (Compress::Raw::Zlib::is_zlibng() || ZLIB_VERNUM >= 0x1220) { is $hdr->{$k}, $v, " $k is $v" } else { ok 1, " Skip test for $k" } @@ -357,4 +361,3 @@ EOM ok $gunz->close ; } } - diff --git a/cpan/IO-Compress/t/011-streamzip.t b/cpan/IO-Compress/t/011-streamzip.t index 668177616f..386ba37a11 100644 --- a/cpan/IO-Compress/t/011-streamzip.t +++ b/cpan/IO-Compress/t/011-streamzip.t @@ -87,7 +87,7 @@ sub check # streamzip -# ######## +# ######### { title "streamzip" ; @@ -123,28 +123,34 @@ for my $method (qw(store deflate bzip2 lzma xz zstd)) { if ($method eq 'lzma') { - eval { require IO::Compress::Lzma } ; + no warnings; + eval { require IO::Compress::Lzma && defined &{ 'IO::Compress::Adapter::Bzip2::mkRawZipCompObject' } } ; skip "Method 'lzma' needs IO::Compress::Lzma\n", 8 if $@; } if ($method eq 'zstd') { - eval { require IO::Compress::Zstd } ; + no warnings; + eval { require IO::Compress::Zstd && defined &{ 'IO::Compress::Adapter::Zstd::mkRawZipCompObject' }} ; 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 + no warnings; + eval { require IO::Compress::Xz && defined &{ 'IO::Compress::Adapter::Xz::mkRawZipCompObject' }} ; + skip "Method 'xz' needs IO::Compress::Xz\n", 8 if $@; } { title "streamzip method $method" ; + skip "streaming unzip not supported with zstd\n", 7 + if $method eq 'zstd' ; + my ($infile, $outfile); my $lex = LexFile->new( $infile, $outfile ); diff --git a/cpan/IO-Compress/t/101truncate-rawdeflate.t b/cpan/IO-Compress/t/101truncate-rawdeflate.t index 371ed5c4b0..6151c6a93e 100644 --- a/cpan/IO-Compress/t/101truncate-rawdeflate.t +++ b/cpan/IO-Compress/t/101truncate-rawdeflate.t @@ -11,6 +11,8 @@ use warnings; use Test::More ; +use Compress::Raw::Zlib; + BEGIN { plan skip_all => "Lengthy Tests Disabled\n" . "set COMPRESS_ZLIB_RUN_ALL or COMPRESS_ZLIB_RUN_MOST to run this test suite" @@ -21,8 +23,8 @@ BEGIN { $extra = 1 if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 }; - plan tests => 625 + $extra; - + my $tests = Compress::Raw::Zlib::is_zlibng() ? 615 : 625; + plan tests => $tests + $extra; }; diff --git a/cpan/IO-Compress/t/111const-deflate.t b/cpan/IO-Compress/t/111const-deflate.t index bdb2eca0f7..f12d6a9390 100644 --- a/cpan/IO-Compress/t/111const-deflate.t +++ b/cpan/IO-Compress/t/111const-deflate.t @@ -20,7 +20,7 @@ BEGIN { $extra = 1 if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 }; - plan tests => 355 + $extra ; + plan tests => 390 + $extra ; } @@ -30,6 +30,8 @@ BEGIN { my %all; for my $symbol (@Compress::Raw::Zlib::DEFLATE_CONSTANTS) { + next if $symbol eq 'Z_NULL'; + eval "defined Compress::Raw::Zlib::$symbol" ; $all{$symbol} = ! $@ ; } diff --git a/cpan/IO-Compress/t/cz-03zlib-v1.t b/cpan/IO-Compress/t/cz-03zlib-v1.t index 41734d055b..73d7b894f7 100644 --- a/cpan/IO-Compress/t/cz-03zlib-v1.t +++ b/cpan/IO-Compress/t/cz-03zlib-v1.t @@ -703,7 +703,8 @@ EOM ($GOT, $status) = $k->inflate($rest) ; # Z_STREAM_END returned by 1.12.2, Z_DATA_ERROR for older zlib - if (ZLIB_VERNUM >= ZLIB_1_2_12_0) + # always Z_STREAM_ENDin zlib_ng + if (ZLIB_VERNUM >= ZLIB_1_2_12_0 || Compress::Raw::Zlib::is_zlibng) { cmp_ok $status, '==', Z_STREAM_END ; } |