Skip to content

Commit d3d7353

Browse files
committed
Update IO-Compress to CPAN version 2.089
[DELTA] 2.089 3 November 2019 * bin/streamzip Add zipstream to EXE_FILES pmqs/IO-Compress#5 7f5ed78e5652125c9ba78aab720e18d384d59c00 fb8cd6480af6303f58fd2e12d4999cd1830f0c5f 2.088 31 October 2019 * t/105oneshot-zip-only.t Fix reset of CompSize 6034da95f1dc5a594edc0d26e6add8d86990ad56 * Add Support Details ad66b6ec4cf175a70e53f74572eed5f403648f11 * Update site for Bzip2 to sourceware 77497aeb2a234889a2b2c4ac7ea2f620895b16a9 * Fix number of tests bc4e234449a82fb00f66af752dfc4c96097b2a4d * Add streamzip script to bin 76d2795d0587bafb0cc398e97142740acba82a42 * zipdetails * Update zipdetails to version 1.11 8958cb3aa90745a4b3369479846846fdca6b4f76 * Zip64 extra field typo f186380d701fe5257f9fc92d69160dc6382cfc24 * t/105oneshot-zip-only.t test with deflated directory 16bfffcf5089af67cb7f68685cc61d06409cba73 * t/105oneshot-zip-only.t Add test for encrypted Zip files 5ad813115aed000f88d7df28261b43c00ae56525 2c64e255feb5a1ee33d033f7eccb6feca12ebe97 * Documentation Updates pmqs/IO-Compress#2 e1fd0d4eda0a8496981cbd83ad06906f4ae586a5 * Mention xz, lzma etc pmqs/IO-Compress#4 126f7b9da97b572d0fb89a9bdcc190c5405c72b8
1 parent 1bff267 commit d3d7353

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+956
-335
lines changed

MANIFEST

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,7 @@ cpan/HTTP-Tiny/t/170_keepalive.t
10071007
cpan/HTTP-Tiny/t/BrokenCookieJar.pm
10081008
cpan/HTTP-Tiny/t/SimpleCookieJar.pm
10091009
cpan/HTTP-Tiny/t/Util.pm
1010+
cpan/IO-Compress/bin/streamzip
10101011
cpan/IO-Compress/bin/zipdetails IO::Compress
10111012
cpan/IO-Compress/lib/Compress/Zlib.pm IO::Compress
10121013
cpan/IO-Compress/lib/File/GlobMapper.pm IO::Compress
@@ -1138,6 +1139,9 @@ cpan/IO-Compress/t/cz-06gzsetp.t IO::Compress
11381139
cpan/IO-Compress/t/cz-08encoding.t IO::Compress
11391140
cpan/IO-Compress/t/cz-14gzopen.t IO::Compress
11401141
cpan/IO-Compress/t/files/bad-efs.zip
1142+
cpan/IO-Compress/t/files/encrypt-aes.zip
1143+
cpan/IO-Compress/t/files/encrypt-standard.zip
1144+
cpan/IO-Compress/t/files/jar.zip
11411145
cpan/IO-Compress/t/files/meta.xml
11421146
cpan/IO-Compress/t/files/test.ods
11431147
cpan/IO-Compress/t/globmapper.t IO::Compress
@@ -6178,6 +6182,7 @@ utils/ptardiff.PL The ptardiff utility
61786182
utils/ptargrep.PL The ptargrep utility
61796183
utils/shasum.PL filter for computing SHA digests (analogous to md5sum)
61806184
utils/splain.PL Stand-alone version of diagnostics.pm
6185+
utils/streamzip.PL
61816186
utils/xsubpp.PL External subroutine preprocessor
61826187
utils/zipdetails.PL display the internal structure of zip files
61836188
vms/descrip_mms.template Template MM[SK] description file for build

Porting/Maintainers.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ package Maintainers;
626626
},
627627

628628
'IO-Compress' => {
629-
'DISTRIBUTION' => 'PMQS/IO-Compress-2.087.tar.gz',
629+
'DISTRIBUTION' => 'PMQS/IO-Compress-2.089.tar.gz',
630630
'FILES' => q[cpan/IO-Compress],
631631
'EXCLUDED' => [
632632
qr{^examples/},

cpan/IO-Compress/Makefile.PL

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use strict ;
44
require 5.006 ;
55

6-
$::VERSION = '2.087' ;
6+
$::VERSION = '2.089' ;
77

88
use lib '.';
99
use private::MakeUtil;
@@ -42,7 +42,7 @@ WriteMakefile(
4242

4343
INSTALLDIRS => ($] >= 5.009 && $] < 5.011 ? 'perl' : 'site'),
4444

45-
EXE_FILES => ['bin/zipdetails'],
45+
EXE_FILES => ['bin/zipdetails', 'bin/streamzip'],
4646

4747
(
4848
$] >= 5.009 && $] <= 5.011001 && ! $ENV{PERL_CORE}

cpan/IO-Compress/bin/streamzip

Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
#!/usr/bin/perl
2+
3+
# Streaming zip
4+
5+
use strict;
6+
use warnings;
7+
8+
use IO::Compress::Zip qw(zip
9+
ZIP_CM_STORE
10+
ZIP_CM_DEFLATE
11+
ZIP_CM_BZIP2
12+
ZIP_CM_LZMA );
13+
use Getopt::Long;
14+
15+
my $VERSION = '1.0';
16+
17+
my $compression_method = ZIP_CM_DEFLATE;
18+
my $stream = 0;
19+
my $zipfile = '-';
20+
my $memberName = '-' ;
21+
my $zip64 = 0 ;
22+
23+
GetOptions("zip64" => \$zip64,
24+
"method=s" => \&lookupMethod,
25+
"stream" => \$stream,
26+
"zipfile=s" => \$zipfile,
27+
"member-name=s" => \$memberName,
28+
'version' => sub { print "$VERSION\n"; exit 0 },
29+
'help' => \&Usage,
30+
)
31+
or Usage();
32+
33+
Usage()
34+
if @ARGV;
35+
36+
37+
zip '-' => $zipfile,
38+
Name => $memberName,
39+
Zip64 => $zip64,
40+
Method => $compression_method,
41+
Stream => $stream
42+
or die "Error creating zip file '$zipfile': $\n" ;
43+
44+
exit 0;
45+
46+
sub lookupMethod
47+
{
48+
my $name = shift;
49+
my $value = shift ;
50+
51+
my %valid = ( store => ZIP_CM_STORE,
52+
deflate => ZIP_CM_DEFLATE,
53+
bzip2 => ZIP_CM_BZIP2,
54+
lzma => ZIP_CM_LZMA,
55+
);
56+
57+
my $method = $valid{ lc $value };
58+
59+
Usage("Unknown method '$value'")
60+
if ! defined $method;
61+
62+
# If LZMA was rquested, check that it is available
63+
if ($method == ZIP_CM_LZMA)
64+
{
65+
eval ' use IO::Compress::Adapter::Lzma';
66+
die "Method =. LZMA needs IO::Compress::Adapter::Lzma\n"
67+
if ! defined $IO::Compress::Lzma::VERSION;
68+
}
69+
70+
$compression_method = $method;
71+
}
72+
73+
sub Usage
74+
{
75+
die <<EOM;
76+
streamzip [OPTIONS]
77+
78+
Stream data from stdin, compress into a Zip container, and stream to stdout.
79+
80+
OPTIONS
81+
82+
-zipfile=F Write zip container to the filename F
83+
-member-name=M member name [Default '-']
84+
-zip64 Create a Zip64-compliant zip file [Default: No]
85+
Use Zip64 if input is greater than 4Gig.
86+
-stream Write a streamed zip file
87+
Only applies when 'zipfile' option is used. [Default: No]
88+
Always enabled when writing to stdout.
89+
-method=M Compress using method "M".
90+
Valid methods are
91+
store Store without compression
92+
deflate Use Deflate compression [Deflault]
93+
bzip2 Use Bzip2 compression
94+
lzma Use LZMA compression [needs IO::Compress::Lzma]
95+
Lzma needs IO::Compress::Lzma to be installed.
96+
-version Display version number [$VERSION]
97+
98+
Copyright (c) 2019 Paul Marquess. All rights reserved.
99+
100+
This program is free software; you can redistribute it and/or
101+
modify it under the same terms as Perl itself.
102+
103+
EOM
104+
}
105+
106+
107+
__END__
108+
=head1 NAME
109+
110+
streamzip - create a zip file from stdin
111+
112+
=head1 SYNOPSIS
113+
114+
producer | streamzip [opts] | comsumer
115+
producer | streamzip [opts] -zipfile=output.zip
116+
117+
=head1 DESCRIPTION
118+
119+
This program will read data from stdin, compress it into a zip container and,
120+
by default, write a I<streamed> zip file to stdout. No temporary files are created.
121+
122+
The zip container written to stdout is, by necessity, written in streaming
123+
format. Most programs that read Zip files can cope with a streamed zip file,
124+
but if interoperability is important, and your workflow allows you to write the
125+
zip file directly to disk you can create a non-streamed zip file using the C<zipfile> option.
126+
127+
=head2 OPTIONS
128+
129+
=over 5
130+
131+
=item -zip64
132+
133+
Create a Zip64-compliant zip container.
134+
Use this option if the input is greater than 4Gig.
135+
136+
Default is disabled.
137+
138+
=item -zipfile=F
139+
140+
Write zip container to the filename F.
141+
142+
Use the C<Stream> option to enable the creation of a streamed zip file.
143+
144+
=item -member-name=M
145+
146+
This option is used to name the "file" in the zip container.
147+
148+
Default is '-'.
149+
150+
=item -stream
151+
152+
Ignored when writing to stdout.
153+
154+
If the C<zipfile> option is specified, including this option
155+
will trigger the creation of a streamed zip file.
156+
157+
Default: Always enabled when writing to stdout, otherwise disabled.
158+
159+
=item -method=M
160+
161+
Compress using method "M".
162+
163+
Valid method names are
164+
165+
* store Store without compression
166+
* deflate Use Deflate compression [Deflault]
167+
* bzip2 Use Bzip2 compression
168+
* lzma Use LZMA compression
169+
170+
Note that Lzma compress needs IO::Compress::Lzma to be installed.
171+
172+
Default is deflate.
173+
174+
=item -version
175+
176+
Display version number [$VERSION]
177+
178+
=item -help
179+
180+
Display help
181+
182+
=back
183+
184+
=head2 When to use a Streamed Zip File
185+
186+
A Zip file created with streaming mode enabled allows you to create a zip file
187+
in situations where you cannot seek backwards/forwards in the file.
188+
189+
A good examples is when you are
190+
serving dynamic content from a Web Server straight into a socket
191+
without needing to create a temporary zip file in the filesystsm.
192+
193+
Similarly if your workfow uses a Linux pipelined commands.
194+
195+
=head1 SUPPORT
196+
197+
General feedback/questions/bug reports should be sent to
198+
L<https://github.com/pmqs/IO-Compress/issues> (preferred) or
199+
L<https://rt.cpan.org/Public/Dist/Display.html?Name=IO-Compress>.
200+
201+
202+
=head1 AUTHOR
203+
204+
Paul Marquess F<[email protected]>.
205+
206+
=head1 COPYRIGHT
207+
208+
Copyright (c) 2019 Paul Marquess. All rights reserved.
209+
210+
This program is free software; you can redistribute it and/or modify it
211+
under the same terms as Perl itself.
212+

cpan/IO-Compress/bin/zipdetails

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ my %Extras = (
180180

181181
);
182182

183-
my $VERSION = "1.10" ;
183+
my $VERSION = "1.11" ;
184184

185185
my $FH;
186186

@@ -1201,7 +1201,7 @@ sub decode_Zip64
12011201
}
12021202

12031203
if (full32 $z64Data->[2] ) {
1204-
out_VV " Offset to Central Dir";
1204+
out_VV " Offset to Local Dir";
12051205
}
12061206

12071207
if ($z64Data->[3] == 0xFFFF ) {
@@ -2175,6 +2175,11 @@ Error handling is still a work in progress. If the program encounters a
21752175
problem reading a zip file it is likely to terminate with an unhelpful
21762176
error message.
21772177
2178+
=head1 SUPPORT
2179+
2180+
General feedback/questions/bug reports should be sent to
2181+
L<https://github.com/pmqs/IO-Compress/issues> (preferred) or
2182+
L<https://rt.cpan.org/Public/Dist/Display.html?Name=IO-Compress>.
21782183
21792184
=head1 SEE ALSO
21802185

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

Lines changed: 12 additions & 6 deletions
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.087 ;
11-
use Compress::Raw::Zlib 2.087 ;
12-
use IO::Compress::Gzip 2.087 ;
13-
use IO::Uncompress::Gunzip 2.087 ;
10+
use IO::Compress::Base::Common 2.089 ;
11+
use Compress::Raw::Zlib 2.089 ;
12+
use IO::Compress::Gzip 2.089 ;
13+
use IO::Uncompress::Gunzip 2.089 ;
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.087';
20+
$VERSION = '2.089';
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.087 ;
464+
use IO::Compress::Gzip::Constants 2.089 ;
465465

466466
sub memGzip($)
467467
{
@@ -1467,6 +1467,12 @@ Returns the version of the zlib library.
14671467
All the I<zlib> constants are automatically imported when you make use
14681468
of I<Compress::Zlib>.
14691469
1470+
=head1 SUPPORT
1471+
1472+
General feedback/questions/bug reports should be sent to
1473+
L<https://github.com/pmqs/IO-Compress/issues> (preferred) or
1474+
L<https://rt.cpan.org/Public/Dist/Display.html?Name=IO-Compress>.
1475+
14701476
=head1 SEE ALSO
14711477
14721478
L<IO::Compress::Gzip>, L<IO::Uncompress::Gunzip>, L<IO::Compress::Deflate>, L<IO::Uncompress::Inflate>, L<IO::Compress::RawDeflate>, L<IO::Uncompress::RawInflate>, L<IO::Compress::Bzip2>, L<IO::Uncompress::Bunzip2>, L<IO::Compress::Lzma>, L<IO::Uncompress::UnLzma>, L<IO::Compress::Xz>, L<IO::Uncompress::UnXz>, L<IO::Compress::Lzip>, L<IO::Uncompress::UnLzip>, L<IO::Compress::Lzop>, L<IO::Uncompress::UnLzop>, L<IO::Compress::Lzf>, L<IO::Uncompress::UnLzf>, L<IO::Compress::Zstd>, L<IO::Uncompress::UnZstd>, L<IO::Uncompress::AnyInflate>, L<IO::Uncompress::AnyUncompress>

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

Lines changed: 3 additions & 3 deletions
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.087 qw(:Status);
7+
use IO::Compress::Base::Common 2.089 qw(:Status);
88

9-
use Compress::Raw::Bzip2 2.087 ;
9+
use Compress::Raw::Bzip2 2.089 ;
1010

1111
our ($VERSION);
12-
$VERSION = '2.087';
12+
$VERSION = '2.089';
1313

1414
sub mkCompObject
1515
{

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

Lines changed: 3 additions & 3 deletions
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.087 qw(:Status);
8-
use Compress::Raw::Zlib 2.087 qw( !crc32 !adler32 ) ;
7+
use IO::Compress::Base::Common 2.089 qw(:Status);
8+
use Compress::Raw::Zlib 2.089 qw( !crc32 !adler32 ) ;
99

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

13-
$VERSION = '2.087';
13+
$VERSION = '2.089';
1414
@ISA = qw(Exporter);
1515
@EXPORT_OK = @Compress::Raw::Zlib::DEFLATE_CONSTANTS;
1616
%EXPORT_TAGS = %Compress::Raw::Zlib::DEFLATE_CONSTANTS;

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

Lines changed: 2 additions & 2 deletions
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.087 qw(:Status);
7+
use IO::Compress::Base::Common 2.089 qw(:Status);
88
our ($VERSION);
99

10-
$VERSION = '2.087';
10+
$VERSION = '2.089';
1111

1212
sub mkCompObject
1313
{

0 commit comments

Comments
 (0)