-
Notifications
You must be signed in to change notification settings - Fork 559
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
From ChangeLog 2.201 25 June 2022 * Disable zib header tests Sat Jun 25 09:10:59 2022 +0100 63eb5d37291b40dbf07d191a09b7876168008cd4 * Version 2.201 Sat Jun 25 09:00:42 2022 +0100 af51310f68bb225d94eaa29b7f3d2bece1935dfd * doc update pmqs/IO-Compress#38 Thu Jun 23 23:00:31 2022 +0100 2002d4fd3b3a6f5de6c6c3dc5989cf42581c1758 * Changes for zlib-ng Thu Jun 23 22:43:50 2022 +0100 2bd52d2918823cc567c3e92dd3d15f87cb4ee8f8 * Add perl 5.36 Sun Jun 5 13:34:18 2022 +0100 ede55370ed4c7eb3c66abc71bc25c7e4019b4c44 * force streaming zip file when writing to stdout * pmqs/IO-Compress#42 Sun Apr 24 19:43:19 2022 +0100 b57a3f83f404f5a24242680de5b406cfcf5c03ac * read zip timestamp in localtime Sun Apr 24 13:11:58 2022 +0100 0c838f43dc46f292714c82145c9add9932196b01 * streamzip: tighten up version tests for failing windows tests * pmqs/IO-Compress#41 Sun Apr 24 12:49:57 2022 +0100 3497645228235ea12c4d559d6dedd4cef47fc94a * streamzip: update year Sun Apr 24 12:11:35 2022 +0100 0ac0d1ef603d8854ffc35976196735b663764992 * Use Time::Local instead of POSIX::mktime Tue Apr 19 11:31:43 2022 +0100 64a106f1119cbc7dec8db52dca016bb8baacf2d4
- Loading branch information
Showing
34 changed files
with
270 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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<[email protected]>. | |
=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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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<[email protected]> and Mark Adler C<[email protected]>. | |
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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,105 +42,42 @@ 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 | ||
{ | ||
return ''; | ||
} | ||
|
||
#sub newHeader | ||
#{ | ||
# my $self = shift ; | ||
# return *$self->{Header}; | ||
#} | ||
|
||
sub getExtraParams | ||
{ | ||
my $self = shift ; | ||
|
@@ -940,6 +877,9 @@ C<[email protected]> and Mark Adler C<[email protected]>. | |
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 | ||
|
Oops, something went wrong.