Skip to content

Commit 5888abc

Browse files
committed
Update IO::Compress to CPAN 2.201
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
1 parent ffad8d3 commit 5888abc

34 files changed

+270
-245
lines changed

cpan/IO-Compress/Makefile.PL

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
use strict ;
44
require 5.006 ;
55

6-
$::VERSION = '2.106' ;
7-
$::DEP_VERSION = '2.103';
6+
$::VERSION = '2.201' ;
7+
$::DEP_VERSION = '2.201';
88

99
use lib '.';
1010
use private::MakeUtil;
@@ -29,6 +29,7 @@ WriteMakefile(
2929
'Compress::Raw::Zlib' => $::DEP_VERSION,
3030
'Scalar::Util' => 0,
3131
'Encode' => 0,
32+
'Time::Local' => 0,
3233
$] >= 5.005 && $] < 5.006
3334
? ('File::BSDGlob' => 0)
3435
: () }

cpan/IO-Compress/bin/streamzip

+9-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use IO::Compress::Zip qw(zip
1212

1313
use Getopt::Long;
1414

15-
my $VERSION = '1.002';
15+
my $VERSION = '1.00';
1616

1717
my $compression_method = ZIP_CM_DEFLATE;
1818
my $stream = 0;
@@ -51,6 +51,10 @@ if ($compression_method == ZIP_CM_DEFLATE && defined $level)
5151
push @extraOpts, (Level => $level)
5252
}
5353

54+
# force streaming zip file when writing to stdout.
55+
$stream = 1
56+
if $zipfile eq '-';
57+
5458
zip '-' => $zipfile,
5559
Name => $memberName,
5660
Zip64 => $zip64,
@@ -107,7 +111,8 @@ Usage:
107111
producer | streamzip [OPTIONS] | consumer
108112
producer | streamzip [OPTIONS] -zipfile output.zip
109113
110-
Stream data from stdin, compress into a Zip container, and stream to stdout.
114+
Stream data from stdin, compress into a Zip container, and either stream to stdout, or
115+
write to a named file.
111116
112117
OPTIONS
113118
@@ -131,7 +136,7 @@ OPTIONS
131136
zstd Use LZMA compression [needs IO::Compress::Zstd]
132137
-version Display version number [$VERSION]
133138
134-
Copyright (c) 2019-2021 Paul Marquess. All rights reserved.
139+
Copyright (c) 2019-2022 Paul Marquess. All rights reserved.
135140
136141
This program is free software; you can redistribute it and/or
137142
modify it under the same terms as Perl itself.
@@ -287,7 +292,7 @@ Paul Marquess F<[email protected]>.
287292
288293
=head1 COPYRIGHT
289294
290-
Copyright (c) 2019-2021 Paul Marquess. All rights reserved.
295+
Copyright (c) 2019-2022 Paul Marquess. All rights reserved.
291296
292297
This program is free software; you can redistribute it and/or modify it
293298
under the same terms as Perl itself.

cpan/IO-Compress/lib/Compress/Zlib.pm

+9-6
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ use Carp ;
77
use IO::Handle ;
88
use Scalar::Util qw(dualvar);
99

10-
use IO::Compress::Base::Common 2.106 ;
11-
use Compress::Raw::Zlib 2.103 ;
12-
use IO::Compress::Gzip 2.106 ;
13-
use IO::Uncompress::Gunzip 2.106 ;
10+
use IO::Compress::Base::Common 2.201 ;
11+
use Compress::Raw::Zlib 2.201 ;
12+
use IO::Compress::Gzip 2.201 ;
13+
use IO::Uncompress::Gunzip 2.201 ;
1414

1515
use strict ;
1616
use warnings ;
1717
use bytes ;
1818
our ($VERSION, $XS_VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
1919

20-
$VERSION = '2.106';
20+
$VERSION = '2.201';
2121
$XS_VERSION = $VERSION;
2222
$VERSION = eval $VERSION;
2323

@@ -461,7 +461,7 @@ sub inflate
461461

462462
package Compress::Zlib ;
463463

464-
use IO::Compress::Gzip::Constants 2.106 ;
464+
use IO::Compress::Gzip::Constants 2.201 ;
465465

466466
sub memGzip($)
467467
{
@@ -1494,6 +1494,9 @@ C<[email protected]> and Mark Adler C<[email protected]>.
14941494
The primary site for the I<zlib> compression library is
14951495
L<http://www.zlib.org>.
14961496
1497+
The primary site for the I<zlib-ng> compression library is
1498+
L<https://github.com/zlib-ng/zlib-ng>.
1499+
14971500
The primary site for gzip is L<http://www.gzip.org>.
14981501
14991502
=head1 AUTHOR

cpan/IO-Compress/lib/IO/Compress/Adapter/Bzip2.pm

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ use strict;
44
use warnings;
55
use bytes;
66

7-
use IO::Compress::Base::Common 2.106 qw(:Status);
7+
use IO::Compress::Base::Common 2.201 qw(:Status);
88

9-
use Compress::Raw::Bzip2 2.103 ;
9+
use Compress::Raw::Bzip2 2.201 ;
1010

1111
our ($VERSION);
12-
$VERSION = '2.106';
12+
$VERSION = '2.201';
1313

1414
sub mkCompObject
1515
{

cpan/IO-Compress/lib/IO/Compress/Adapter/Deflate.pm

+26-3
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ use strict;
44
use warnings;
55
use bytes;
66

7-
use IO::Compress::Base::Common 2.106 qw(:Status);
8-
use Compress::Raw::Zlib 2.103 qw( !crc32 !adler32 ) ;
7+
use IO::Compress::Base::Common 2.201 qw(:Status);
8+
use Compress::Raw::Zlib 2.201 qw( !crc32 !adler32 ) ;
99

1010
require Exporter;
1111
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, @EXPORT, %DEFLATE_CONSTANTS);
1212

13-
$VERSION = '2.106';
13+
$VERSION = '2.201';
1414
@ISA = qw(Exporter);
1515
@EXPORT_OK = @Compress::Raw::Zlib::DEFLATE_CONSTANTS;
1616
%EXPORT_TAGS = %Compress::Raw::Zlib::DEFLATE_CONSTANTS;
@@ -40,6 +40,29 @@ sub mkCompObject
4040
} ;
4141
}
4242

43+
sub mkCompObject1
44+
{
45+
my $crc32 = shift ;
46+
my $adler32 = shift ;
47+
my $level = shift ;
48+
my $strategy = shift ;
49+
50+
my ($def, $status) = Compress::Raw::Zlib::Deflate->new(
51+
-AppendOutput => 1,
52+
-CRC32 => $crc32,
53+
-ADLER32 => $adler32,
54+
-Level => $level,
55+
-Strategy => $strategy,
56+
-WindowBits => MAX_WBITS);
57+
58+
return (undef, "Cannot create Deflate object: $status", $status)
59+
if $status != Z_OK;
60+
61+
return bless {'Def' => $def,
62+
'Error' => '',
63+
} ;
64+
}
65+
4366
sub compr
4467
{
4568
my $self = shift ;

cpan/IO-Compress/lib/IO/Compress/Adapter/Identity.pm

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ use strict;
44
use warnings;
55
use bytes;
66

7-
use IO::Compress::Base::Common 2.106 qw(:Status);
7+
use IO::Compress::Base::Common 2.201 qw(:Status);
88
our ($VERSION);
99

10-
$VERSION = '2.106';
10+
$VERSION = '2.201';
1111

1212
sub mkCompObject
1313
{

cpan/IO-Compress/lib/IO/Compress/Base.pm

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require 5.006 ;
66
use strict ;
77
use warnings;
88

9-
use IO::Compress::Base::Common 2.106 ;
9+
use IO::Compress::Base::Common 2.201 ;
1010

1111
use IO::File (); ;
1212
use Scalar::Util ();
@@ -20,7 +20,7 @@ use Symbol();
2020
our (@ISA, $VERSION);
2121
@ISA = qw(IO::File Exporter);
2222

23-
$VERSION = '2.106';
23+
$VERSION = '2.201';
2424

2525
#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.
2626

cpan/IO-Compress/lib/IO/Compress/Base/Common.pm

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use File::GlobMapper;
1111
require Exporter;
1212
our ($VERSION, @ISA, @EXPORT, %EXPORT_TAGS, $HAS_ENCODE);
1313
@ISA = qw(Exporter);
14-
$VERSION = '2.106';
14+
$VERSION = '2.201';
1515

1616
@EXPORT = qw( isaFilehandle isaFilename isaScalar
1717
whatIsInput whatIsOutput

cpan/IO-Compress/lib/IO/Compress/Bzip2.pm

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ use warnings;
55
use bytes;
66
require Exporter ;
77

8-
use IO::Compress::Base 2.106 ;
8+
use IO::Compress::Base 2.201 ;
99

10-
use IO::Compress::Base::Common 2.106 qw();
11-
use IO::Compress::Adapter::Bzip2 2.106 ;
10+
use IO::Compress::Base::Common 2.201 qw();
11+
use IO::Compress::Adapter::Bzip2 2.201 ;
1212

1313

1414

1515
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $Bzip2Error);
1616

17-
$VERSION = '2.106';
17+
$VERSION = '2.201';
1818
$Bzip2Error = '';
1919

2020
@ISA = qw(IO::Compress::Base Exporter);
@@ -51,7 +51,7 @@ sub getExtraParams
5151
{
5252
my $self = shift ;
5353

54-
use IO::Compress::Base::Common 2.106 qw(:Parse);
54+
use IO::Compress::Base::Common 2.201 qw(:Parse);
5555

5656
return (
5757
'blocksize100k' => [IO::Compress::Base::Common::Parse_unsigned, 1],

cpan/IO-Compress/lib/IO/Compress/Deflate.pm

+23-83
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ use bytes;
88

99
require Exporter ;
1010

11-
use IO::Compress::RawDeflate 2.106 ();
12-
use IO::Compress::Adapter::Deflate 2.106 ;
11+
use IO::Compress::RawDeflate 2.201 ();
12+
use IO::Compress::Adapter::Deflate 2.201 ;
1313

14-
use IO::Compress::Zlib::Constants 2.106 ;
15-
use IO::Compress::Base::Common 2.106 qw();
14+
use IO::Compress::Zlib::Constants 2.201 ;
15+
use IO::Compress::Base::Common 2.201 qw();
1616

1717

1818
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $DeflateError);
1919

20-
$VERSION = '2.106';
20+
$VERSION = '2.201';
2121
$DeflateError = '';
2222

2323
@ISA = qw(IO::Compress::RawDeflate Exporter);
@@ -42,105 +42,42 @@ sub deflate
4242
return $obj->_def(@_);
4343
}
4444

45-
46-
sub bitmask($$$$)
47-
{
48-
my $into = shift ;
49-
my $value = shift ;
50-
my $offset = shift ;
51-
my $mask = shift ;
52-
53-
return $into | (($value & $mask) << $offset ) ;
54-
}
55-
56-
sub mkDeflateHdr($$$;$)
57-
{
58-
my $method = shift ;
59-
my $cinfo = shift;
60-
my $level = shift;
61-
my $fdict_adler = shift ;
62-
63-
my $cmf = 0;
64-
my $flg = 0;
65-
my $fdict = 0;
66-
$fdict = 1 if defined $fdict_adler;
67-
68-
$cmf = bitmask($cmf, $method, ZLIB_CMF_CM_OFFSET, ZLIB_CMF_CM_BITS);
69-
$cmf = bitmask($cmf, $cinfo, ZLIB_CMF_CINFO_OFFSET, ZLIB_CMF_CINFO_BITS);
70-
71-
$flg = bitmask($flg, $fdict, ZLIB_FLG_FDICT_OFFSET, ZLIB_FLG_FDICT_BITS);
72-
$flg = bitmask($flg, $level, ZLIB_FLG_LEVEL_OFFSET, ZLIB_FLG_LEVEL_BITS);
73-
74-
my $fcheck = 31 - ($cmf * 256 + $flg) % 31 ;
75-
$flg = bitmask($flg, $fcheck, ZLIB_FLG_FCHECK_OFFSET, ZLIB_FLG_FCHECK_BITS);
76-
77-
my $hdr = pack("CC", $cmf, $flg) ;
78-
$hdr .= pack("N", $fdict_adler) if $fdict ;
79-
80-
return $hdr;
81-
}
82-
83-
sub mkHeader
45+
sub mkComp
8446
{
8547
my $self = shift ;
86-
my $param = shift ;
48+
my $got = shift ;
8749

88-
my $level = $param->getValue('level');
89-
my $strategy = $param->getValue('strategy');
50+
my ($obj, $errstr, $errno) = IO::Compress::Adapter::Deflate::mkCompObject1(
51+
$got->getValue('crc32'),
52+
$got->getValue('adler32'),
53+
$got->getValue('level'),
54+
$got->getValue('strategy')
55+
);
9056

91-
my $lflag ;
92-
$level = 6
93-
if $level == Z_DEFAULT_COMPRESSION ;
57+
return $self->saveErrorString(undef, $errstr, $errno)
58+
if ! defined $obj;
9459

95-
if (ZLIB_VERNUM >= 0x1210)
96-
{
97-
if ($strategy >= Z_HUFFMAN_ONLY || $level < 2)
98-
{ $lflag = ZLIB_FLG_LEVEL_FASTEST }
99-
elsif ($level < 6)
100-
{ $lflag = ZLIB_FLG_LEVEL_FAST }
101-
elsif ($level == 6)
102-
{ $lflag = ZLIB_FLG_LEVEL_DEFAULT }
103-
else
104-
{ $lflag = ZLIB_FLG_LEVEL_SLOWEST }
105-
}
106-
else
107-
{
108-
$lflag = ($level - 1) >> 1 ;
109-
$lflag = 3 if $lflag > 3 ;
110-
}
111-
112-
#my $wbits = (MAX_WBITS - 8) << 4 ;
113-
my $wbits = 7;
114-
mkDeflateHdr(ZLIB_CMF_CM_DEFLATED, $wbits, $lflag);
60+
return $obj;
11561
}
11662

117-
sub ckParams
63+
64+
sub mkHeader
11865
{
11966
my $self = shift ;
120-
my $got = shift;
121-
122-
$got->setValue('adler32' => 1);
123-
return 1 ;
67+
return '';
12468
}
12569

126-
12770
sub mkTrailer
12871
{
12972
my $self = shift ;
130-
return pack("N", *$self->{Compress}->adler32()) ;
73+
return '';
13174
}
13275

13376
sub mkFinalTrailer
13477
{
13578
return '';
13679
}
13780

138-
#sub newHeader
139-
#{
140-
# my $self = shift ;
141-
# return *$self->{Header};
142-
#}
143-
14481
sub getExtraParams
14582
{
14683
my $self = shift ;
@@ -940,6 +877,9 @@ C<[email protected]> and Mark Adler C<[email protected]>.
940877
The primary site for the I<zlib> compression library is
941878
L<http://www.zlib.org>.
942879
880+
The primary site for the I<zlib-ng> compression library is
881+
L<https://github.com/zlib-ng/zlib-ng>.
882+
943883
The primary site for gzip is L<http://www.gzip.org>.
944884
945885
=head1 AUTHOR

0 commit comments

Comments
 (0)