diff --git a/cpan/IO-Compress/Makefile.PL b/cpan/IO-Compress/Makefile.PL index 8e9acfe7cf5f3..e9d20a412bdc8 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 d0f92fb620e73..199599ee38eab 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. =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 37aa051557d87..59dfbf6d1b16f 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 and Mark Adler C. The primary site for the I compression library is L. +The primary site for the I compression library is +L. + The primary site for gzip is L. =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 cc1700aab2609..3ff2b4f57f2eb 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 12f97ccc52d98..08555e944139f 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 a21962ea1aa18..99263d02a73e2 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 fdb169d7716a0..8941c271cdd46 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 39ac01685896c..7374ce4577573 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 faf043b15404f..7c18059d84118 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 0998952b4de98..4f239ed34f37f 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 and Mark Adler C. The primary site for the I compression library is L. +The primary site for the I compression library is +L. + The primary site for gzip is L. =head1 AUTHOR diff --git a/cpan/IO-Compress/lib/IO/Compress/Gzip.pm b/cpan/IO-Compress/lib/IO/Compress/Gzip.pm index 0471e33ea7a54..e81106692e0df 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 and Mark Adler C. The primary site for the I compression library is L. +The primary site for the I compression library is +L. + The primary site for gzip is L. =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 8e32e17d590a5..c9c6866e730ab 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 de0f332ecb838..ee9079989acab 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 and Mark Adler C. The primary site for the I compression library is L. +The primary site for the I compression library is +L. + The primary site for gzip is L. =head1 AUTHOR diff --git a/cpan/IO-Compress/lib/IO/Compress/Zip.pm b/cpan/IO-Compress/lib/IO/Compress/Zip.pm index ecba767727bc2..0f33e7b82a3db 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 for more details. If the C<$input_filename_or_reference> parameter is any other type, C will be returned. -In addition, if C<$input_filename_or_reference> is a simple filename, -the default values for -the C, C