Skip to content

Commit

Permalink
Update IO-Compress to CPAN version 2.089
Browse files Browse the repository at this point in the history
  [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
  • Loading branch information
bingos committed Nov 6, 2019
1 parent 1bff267 commit d3d7353
Show file tree
Hide file tree
Showing 43 changed files with 956 additions and 335 deletions.
5 changes: 5 additions & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,7 @@ cpan/HTTP-Tiny/t/170_keepalive.t
cpan/HTTP-Tiny/t/BrokenCookieJar.pm
cpan/HTTP-Tiny/t/SimpleCookieJar.pm
cpan/HTTP-Tiny/t/Util.pm
cpan/IO-Compress/bin/streamzip
cpan/IO-Compress/bin/zipdetails IO::Compress
cpan/IO-Compress/lib/Compress/Zlib.pm IO::Compress
cpan/IO-Compress/lib/File/GlobMapper.pm IO::Compress
Expand Down Expand Up @@ -1138,6 +1139,9 @@ cpan/IO-Compress/t/cz-06gzsetp.t IO::Compress
cpan/IO-Compress/t/cz-08encoding.t IO::Compress
cpan/IO-Compress/t/cz-14gzopen.t IO::Compress
cpan/IO-Compress/t/files/bad-efs.zip
cpan/IO-Compress/t/files/encrypt-aes.zip
cpan/IO-Compress/t/files/encrypt-standard.zip
cpan/IO-Compress/t/files/jar.zip
cpan/IO-Compress/t/files/meta.xml
cpan/IO-Compress/t/files/test.ods
cpan/IO-Compress/t/globmapper.t IO::Compress
Expand Down Expand Up @@ -6178,6 +6182,7 @@ utils/ptardiff.PL The ptardiff utility
utils/ptargrep.PL The ptargrep utility
utils/shasum.PL filter for computing SHA digests (analogous to md5sum)
utils/splain.PL Stand-alone version of diagnostics.pm
utils/streamzip.PL
utils/xsubpp.PL External subroutine preprocessor
utils/zipdetails.PL display the internal structure of zip files
vms/descrip_mms.template Template MM[SK] description file for build
Expand Down
2 changes: 1 addition & 1 deletion Porting/Maintainers.pl
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ package Maintainers;
},

'IO-Compress' => {
'DISTRIBUTION' => 'PMQS/IO-Compress-2.087.tar.gz',
'DISTRIBUTION' => 'PMQS/IO-Compress-2.089.tar.gz',
'FILES' => q[cpan/IO-Compress],
'EXCLUDED' => [
qr{^examples/},
Expand Down
4 changes: 2 additions & 2 deletions cpan/IO-Compress/Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use strict ;
require 5.006 ;

$::VERSION = '2.087' ;
$::VERSION = '2.089' ;

use lib '.';
use private::MakeUtil;
Expand Down Expand Up @@ -42,7 +42,7 @@ WriteMakefile(

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

EXE_FILES => ['bin/zipdetails'],
EXE_FILES => ['bin/zipdetails', 'bin/streamzip'],

(
$] >= 5.009 && $] <= 5.011001 && ! $ENV{PERL_CORE}
Expand Down
212 changes: 212 additions & 0 deletions cpan/IO-Compress/bin/streamzip
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
#!/usr/bin/perl

# Streaming zip

use strict;
use warnings;

use IO::Compress::Zip qw(zip
ZIP_CM_STORE
ZIP_CM_DEFLATE
ZIP_CM_BZIP2
ZIP_CM_LZMA );
use Getopt::Long;

my $VERSION = '1.0';

my $compression_method = ZIP_CM_DEFLATE;
my $stream = 0;
my $zipfile = '-';
my $memberName = '-' ;
my $zip64 = 0 ;

GetOptions("zip64" => \$zip64,
"method=s" => \&lookupMethod,
"stream" => \$stream,
"zipfile=s" => \$zipfile,
"member-name=s" => \$memberName,
'version' => sub { print "$VERSION\n"; exit 0 },
'help' => \&Usage,
)
or Usage();

Usage()
if @ARGV;


zip '-' => $zipfile,
Name => $memberName,
Zip64 => $zip64,
Method => $compression_method,
Stream => $stream
or die "Error creating zip file '$zipfile': $\n" ;

exit 0;

sub lookupMethod
{
my $name = shift;
my $value = shift ;

my %valid = ( store => ZIP_CM_STORE,
deflate => ZIP_CM_DEFLATE,
bzip2 => ZIP_CM_BZIP2,
lzma => ZIP_CM_LZMA,
);

my $method = $valid{ lc $value };

Usage("Unknown method '$value'")
if ! defined $method;

# If LZMA was rquested, check that it is available
if ($method == ZIP_CM_LZMA)
{
eval ' use IO::Compress::Adapter::Lzma';
die "Method =. LZMA needs IO::Compress::Adapter::Lzma\n"
if ! defined $IO::Compress::Lzma::VERSION;
}

$compression_method = $method;
}

sub Usage
{
die <<EOM;
streamzip [OPTIONS]
Stream data from stdin, compress into a Zip container, and stream to stdout.
OPTIONS
-zipfile=F Write zip container to the filename F
-member-name=M member name [Default '-']
-zip64 Create a Zip64-compliant zip file [Default: No]
Use Zip64 if input is greater than 4Gig.
-stream Write a streamed zip file
Only applies when 'zipfile' option is used. [Default: No]
Always enabled when writing to stdout.
-method=M Compress using method "M".
Valid methods are
store Store without compression
deflate Use Deflate compression [Deflault]
bzip2 Use Bzip2 compression
lzma Use LZMA compression [needs IO::Compress::Lzma]
Lzma needs IO::Compress::Lzma to be installed.
-version Display version number [$VERSION]
Copyright (c) 2019 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.
EOM
}


__END__
=head1 NAME
streamzip - create a zip file from stdin
=head1 SYNOPSIS
producer | streamzip [opts] | comsumer
producer | streamzip [opts] -zipfile=output.zip
=head1 DESCRIPTION
This program will read data from stdin, compress it into a zip container and,
by default, write a I<streamed> zip file to stdout. No temporary files are created.
The zip container written to stdout is, by necessity, written in streaming
format. Most programs that read Zip files can cope with a streamed zip file,
but if interoperability is important, and your workflow allows you to write the
zip file directly to disk you can create a non-streamed zip file using the C<zipfile> option.
=head2 OPTIONS
=over 5
=item -zip64
Create a Zip64-compliant zip container.
Use this option if the input is greater than 4Gig.
Default is disabled.
=item -zipfile=F
Write zip container to the filename F.
Use the C<Stream> option to enable the creation of a streamed zip file.
=item -member-name=M
This option is used to name the "file" in the zip container.
Default is '-'.
=item -stream
Ignored when writing to stdout.
If the C<zipfile> option is specified, including this option
will trigger the creation of a streamed zip file.
Default: Always enabled when writing to stdout, otherwise disabled.
=item -method=M
Compress using method "M".
Valid method names are
* store Store without compression
* deflate Use Deflate compression [Deflault]
* bzip2 Use Bzip2 compression
* lzma Use LZMA compression
Note that Lzma compress needs IO::Compress::Lzma to be installed.
Default is deflate.
=item -version
Display version number [$VERSION]
=item -help
Display help
=back
=head2 When to use a Streamed Zip File
A Zip file created with streaming mode enabled allows you to create a zip file
in situations where you cannot seek backwards/forwards in the file.
A good examples is when you are
serving dynamic content from a Web Server straight into a socket
without needing to create a temporary zip file in the filesystsm.
Similarly if your workfow uses a Linux pipelined commands.
=head1 SUPPORT
General feedback/questions/bug reports should be sent to
L<https://github.com/pmqs/IO-Compress/issues> (preferred) or
L<https://rt.cpan.org/Public/Dist/Display.html?Name=IO-Compress>.
=head1 AUTHOR
Paul Marquess F<[email protected]>.
=head1 COPYRIGHT
Copyright (c) 2019 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.
9 changes: 7 additions & 2 deletions cpan/IO-Compress/bin/zipdetails
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ my %Extras = (

);

my $VERSION = "1.10" ;
my $VERSION = "1.11" ;

my $FH;

Expand Down Expand Up @@ -1201,7 +1201,7 @@ sub decode_Zip64
}

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

if ($z64Data->[3] == 0xFFFF ) {
Expand Down Expand Up @@ -2175,6 +2175,11 @@ Error handling is still a work in progress. If the program encounters a
problem reading a zip file it is likely to terminate with an unhelpful
error message.
=head1 SUPPORT
General feedback/questions/bug reports should be sent to
L<https://github.com/pmqs/IO-Compress/issues> (preferred) or
L<https://rt.cpan.org/Public/Dist/Display.html?Name=IO-Compress>.
=head1 SEE ALSO
Expand Down
18 changes: 12 additions & 6 deletions cpan/IO-Compress/lib/Compress/Zlib.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ use Carp ;
use IO::Handle ;
use Scalar::Util qw(dualvar);

use IO::Compress::Base::Common 2.087 ;
use Compress::Raw::Zlib 2.087 ;
use IO::Compress::Gzip 2.087 ;
use IO::Uncompress::Gunzip 2.087 ;
use IO::Compress::Base::Common 2.089 ;
use Compress::Raw::Zlib 2.089 ;
use IO::Compress::Gzip 2.089 ;
use IO::Uncompress::Gunzip 2.089 ;

use strict ;
use warnings ;
use bytes ;
our ($VERSION, $XS_VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);

$VERSION = '2.087';
$VERSION = '2.089';
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;

Expand Down Expand Up @@ -461,7 +461,7 @@ sub inflate

package Compress::Zlib ;

use IO::Compress::Gzip::Constants 2.087 ;
use IO::Compress::Gzip::Constants 2.089 ;

sub memGzip($)
{
Expand Down Expand Up @@ -1467,6 +1467,12 @@ Returns the version of the zlib library.
All the I<zlib> constants are automatically imported when you make use
of I<Compress::Zlib>.
=head1 SUPPORT
General feedback/questions/bug reports should be sent to
L<https://github.com/pmqs/IO-Compress/issues> (preferred) or
L<https://rt.cpan.org/Public/Dist/Display.html?Name=IO-Compress>.
=head1 SEE ALSO
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>
Expand Down
6 changes: 3 additions & 3 deletions cpan/IO-Compress/lib/IO/Compress/Adapter/Bzip2.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ use strict;
use warnings;
use bytes;

use IO::Compress::Base::Common 2.087 qw(:Status);
use IO::Compress::Base::Common 2.089 qw(:Status);

use Compress::Raw::Bzip2 2.087 ;
use Compress::Raw::Bzip2 2.089 ;

our ($VERSION);
$VERSION = '2.087';
$VERSION = '2.089';

sub mkCompObject
{
Expand Down
6 changes: 3 additions & 3 deletions cpan/IO-Compress/lib/IO/Compress/Adapter/Deflate.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ use strict;
use warnings;
use bytes;

use IO::Compress::Base::Common 2.087 qw(:Status);
use Compress::Raw::Zlib 2.087 qw( !crc32 !adler32 ) ;
use IO::Compress::Base::Common 2.089 qw(:Status);
use Compress::Raw::Zlib 2.089 qw( !crc32 !adler32 ) ;

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

$VERSION = '2.087';
$VERSION = '2.089';
@ISA = qw(Exporter);
@EXPORT_OK = @Compress::Raw::Zlib::DEFLATE_CONSTANTS;
%EXPORT_TAGS = %Compress::Raw::Zlib::DEFLATE_CONSTANTS;
Expand Down
4 changes: 2 additions & 2 deletions cpan/IO-Compress/lib/IO/Compress/Adapter/Identity.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ use strict;
use warnings;
use bytes;

use IO::Compress::Base::Common 2.087 qw(:Status);
use IO::Compress::Base::Common 2.089 qw(:Status);
our ($VERSION);

$VERSION = '2.087';
$VERSION = '2.089';

sub mkCompObject
{
Expand Down
Loading

0 comments on commit d3d7353

Please sign in to comment.