diff options
author | Steve Hay <steve.m.hay@googlemail.com> | 2018-07-03 09:06:01 +0100 |
---|---|---|
committer | Steve Hay <steve.m.hay@googlemail.com> | 2018-07-03 17:26:56 +0100 |
commit | 729f45d7bf3b2bb45c58073d57074aa8ba1feb6d (patch) | |
tree | da1c12802e75cd49240cf7e46e0bcef2391b2794 /cpan/IO-Compress/lib | |
parent | 6bc1010743ba2c77c0c188431170b64f3eb78aed (diff) | |
download | perl-729f45d7bf3b2bb45c58073d57074aa8ba1feb6d.tar.gz |
Upgrade IO-Compress from version 2.074 to 2.081
Diffstat (limited to 'cpan/IO-Compress/lib')
28 files changed, 814 insertions, 833 deletions
diff --git a/cpan/IO-Compress/lib/Compress/Zlib.pm b/cpan/IO-Compress/lib/Compress/Zlib.pm index 86da8340ff..36b224f526 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.074 ; -use Compress::Raw::Zlib 2.074 ; -use IO::Compress::Gzip 2.074 ; -use IO::Uncompress::Gunzip 2.074 ; +use IO::Compress::Base::Common 2.081 ; +use Compress::Raw::Zlib 2.081 ; +use IO::Compress::Gzip 2.081 ; +use IO::Uncompress::Gunzip 2.081 ; use strict ; use warnings ; use bytes ; our ($VERSION, $XS_VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); -$VERSION = '2.074'; +$VERSION = '2.081'; $XS_VERSION = $VERSION; $VERSION = eval $VERSION; @@ -461,7 +461,7 @@ sub inflate package Compress::Zlib ; -use IO::Compress::Gzip::Constants 2.074 ; +use IO::Compress::Gzip::Constants 2.081 ; sub memGzip($) { @@ -662,7 +662,7 @@ Compress::Zlib - Interface to zlib compression library $status = $gz->gzclose() ; $status = $gz->gzeof() ; $status = $gz->gzsetparams($level, $strategy) ; - $errstring = $gz->gzerror() ; + $errstring = $gz->gzerror() ; $gzerrno $dest = Compress::Zlib::memGzip($buffer) ; @@ -680,7 +680,7 @@ Compress::Zlib - Interface to zlib compression library The I<Compress::Zlib> module provides a Perl interface to the I<zlib> compression library (see L</AUTHOR> for details about where to get -I<zlib>). +I<zlib>). The C<Compress::Zlib> module can be split into two general areas of functionality, namely a simple read/write interface to I<gzip> files @@ -694,11 +694,11 @@ The main change in C<Compress::Zlib> version 2.x is that it does not now interface directly to the zlib library. Instead it uses the C<IO::Compress::Gzip> and C<IO::Uncompress::Gunzip> modules for reading/writing gzip files, and the C<Compress::Raw::Zlib> module for some -low-level zlib access. +low-level zlib access. The interface provided by version 2 of this module should be 100% backward compatible with version 1. If you find a difference in the expected -behaviour please contact the author (See L</AUTHOR>). See L<GZIP INTERFACE> +behaviour please contact the author (See L</AUTHOR>). See L<GZIP INTERFACE> With the creation of the C<IO::Compress> and C<IO::Uncompress> modules no new features are planned for C<Compress::Zlib> - the new modules do @@ -712,7 +712,7 @@ new C<IO::Compress> or C<IO::Uncompress> modules. A number of functions are supplied in I<zlib> for reading and writing I<gzip> files that conform to RFC 1952. This module provides an interface -to most of them. +to most of them. If you have previously used C<Compress::Zlib> 1.x, the following enhancements/changes have been made to the C<gzopen> interface: @@ -725,7 +725,7 @@ If you want to open either STDIN or STDOUT with C<gzopen>, you can now optionally use the special filename "C<->" as a synonym for C<\*STDIN> and C<\*STDOUT>. -=item 2 +=item 2 In C<Compress::Zlib> version 1.x, C<gzopen> used the zlib library to open the underlying file. This made things especially tricky when a Perl @@ -736,7 +736,7 @@ the zlib library. Apart from being non-portable to some operating systems, this made it difficult to use C<gzopen> in situations where you wanted to extract/create a gzip data stream that is embedded in a larger file, without having to -resort to opening and closing the file multiple times. +resort to opening and closing the file multiple times. It also made it impossible to pass a perl filehandle that wasn't associated with a real filesystem file, like, say, an C<IO::String>. @@ -768,7 +768,7 @@ L<IO::Uncompress::Gunzip|IO::Uncompress::Gunzip> for more details. =item B<$gz = gzopen($filehandle, $mode)> This function opens either the I<gzip> file C<$filename> for reading or -writing or attaches to the opened filehandle, C<$filehandle>. +writing or attaches to the opened filehandle, C<$filehandle>. It returns an object on success and C<undef> on failure. When writing a gzip file this interface will I<always> create the smallest @@ -812,7 +812,7 @@ the case of an error, -1. =item B<$bytesread = $gz-E<gt>gzreadline($line) ;> -Reads the next line from the compressed file into C<$line>. +Reads the next line from the compressed file into C<$line>. Returns the number of bytes actually read. On EOF it returns 0 and in the case of an error, -1. @@ -821,7 +821,7 @@ It is legal to intermix calls to C<gzread> and C<gzreadline>. To maintain backward compatibility with version 1.x of this module C<gzreadline> ignores the C<$/> variable - it I<always> uses the string -C<"\n"> as the line delimiter. +C<"\n"> as the line delimiter. If you want to read a gzip file a line at a time and have it respect the C<$/> variable (or C<$INPUT_RECORD_SEPARATOR>, or C<$RS> when C<English> is @@ -891,7 +891,7 @@ C<Z_DEFAULT_COMPRESSION>. =item B<$strategy> Defines the strategy used to tune the compression. The valid values are -C<Z_DEFAULT_STRATEGY>, C<Z_FILTERED> and C<Z_HUFFMAN_ONLY>. +C<Z_DEFAULT_STRATEGY>, C<Z_FILTERED> and C<Z_HUFFMAN_ONLY>. =back @@ -947,12 +947,12 @@ I<gzcat> function. foreach my $file (@ARGV) { my $buffer ; - my $gz = gzopen($file, "rb") + my $gz = gzopen($file, "rb") or die "Cannot open $file: $gzerrno\n" ; print $buffer while $gz->gzread($buffer) > 0 ; - die "Error reading from $file: $gzerrno" . ($gzerrno+0) . "\n" + die "Error reading from $file: $gzerrno" . ($gzerrno+0) . "\n" if $gzerrno != Z_STREAM_END ; $gz->gzclose() ; @@ -975,14 +975,14 @@ very simple I<grep> like script. @ARGV = '-' unless @ARGV ; foreach my $file (@ARGV) { - my $gz = gzopen($file, "rb") + my $gz = gzopen($file, "rb") or die "Cannot open $file: $gzerrno\n" ; while ($gz->gzreadline($_) > 0) { print if /$pattern/ ; } - die "Error reading from $file: $gzerrno\n" + die "Error reading from $file: $gzerrno\n" if $gzerrno != Z_STREAM_END ; $gz->gzclose() ; @@ -1003,7 +1003,7 @@ standard output. or die "Cannot open stdout: $gzerrno\n" ; while (<>) { - $gz->gzwrite($_) + $gz->gzwrite($_) or die "error writing: $gzerrno\n" ; } @@ -1014,7 +1014,7 @@ standard output. This function is used to create an in-memory gzip file with the minimum possible gzip header (exactly 10 bytes). - $dest = Compress::Zlib::memGzip($buffer) + $dest = Compress::Zlib::memGzip($buffer) or die "Cannot compress: $gzerrno\n"; If successful, it returns the in-memory gzip file. Otherwise it returns @@ -1029,7 +1029,7 @@ carry out in-memory gzip compression. This function is used to uncompress an in-memory gzip file. - $dest = Compress::Zlib::memGunzip($buffer) + $dest = Compress::Zlib::memGunzip($buffer) or die "Cannot uncompress: $gzerrno\n"; If successful, it returns the uncompressed gzip file. Otherwise it @@ -1092,7 +1092,7 @@ Here is a definition of the interface available: =head2 B<($d, $status) = deflateInit( [OPT] )> -Initialises a deflation stream. +Initialises a deflation stream. It combines the features of the I<zlib> functions C<deflateInit>, C<deflateInit2> and C<deflateSetDictionary>. @@ -1152,7 +1152,7 @@ Defaults to MAX_MEM_LEVEL. =item B<-Strategy> Defines the strategy used to tune the compression. The valid values are -C<Z_DEFAULT_STRATEGY>, C<Z_FILTERED> and C<Z_HUFFMAN_ONLY>. +C<Z_DEFAULT_STRATEGY>, C<Z_FILTERED> and C<Z_HUFFMAN_ONLY>. The default is Z_DEFAULT_STRATEGY. @@ -1160,7 +1160,7 @@ The default is Z_DEFAULT_STRATEGY. When a dictionary is specified I<Compress::Zlib> will automatically call C<deflateSetDictionary> directly after calling C<deflateInit>. The -Adler32 value for the dictionary can be obtained by calling the method +Adler32 value for the dictionary can be obtained by calling the method C<$d->dict_adler()>. The default is no dictionary. @@ -1179,7 +1179,7 @@ Here is an example of using the C<deflateInit> optional parameter list to override the default buffer size and compression level. All other options will take their default values. - deflateInit( -Bufsize => 300, + deflateInit( -Bufsize => 300, -Level => Z_BEST_SPEED ) ; =head2 B<($out, $status) = $d-E<gt>deflate($buffer)> @@ -1236,7 +1236,7 @@ C<Z_DEFAULT_COMPRESSION>. =item B<-Strategy> Defines the strategy used to tune the compression. The valid values are -C<Z_DEFAULT_STRATEGY>, C<Z_FILTERED> and C<Z_HUFFMAN_ONLY>. +C<Z_DEFAULT_STRATEGY>, C<Z_FILTERED> and C<Z_HUFFMAN_ONLY>. =back @@ -1298,7 +1298,7 @@ Here is a definition of the interface: =head2 B<($i, $status) = inflateInit()> -Initialises an inflation stream. +Initialises an inflation stream. In a list context it returns the inflation stream, C<$i>, and the I<zlib> status code in C<$status>. In a scalar context it returns the @@ -1339,7 +1339,7 @@ Defaults to MAX_WBITS. Sets the initial size for the inflation buffer. If the buffer has to be reallocated to increase the size, it will grow in increments of -C<Bufsize>. +C<Bufsize>. Default is 4096. @@ -1360,7 +1360,7 @@ Inflates the complete contents of C<$buffer>. The buffer can either be a scalar or a scalar reference. Returns C<Z_OK> if successful and C<Z_STREAM_END> if the end of the -compressed data has been successfully reached. +compressed data has been successfully reached. If not successful, C<$out> will be I<undef> and C<$status> will hold the I<zlib> error code. @@ -1424,7 +1424,7 @@ Here is an example of using C<inflate>. { ($output, $status) = $x->inflate(\$input) ; - print $output + print $output if $status == Z_OK or $status == Z_STREAM_END ; last if $status != Z_OK ; @@ -1477,7 +1477,7 @@ L<File::GlobMapper|File::GlobMapper>, L<Archive::Zip|Archive::Zip>, L<Archive::Tar|Archive::Tar>, L<IO::Zlib|IO::Zlib> -For RFC 1950, 1951 and 1952 see +For RFC 1950, 1951 and 1952 see L<http://www.faqs.org/rfcs/rfc1950.html>, L<http://www.faqs.org/rfcs/rfc1951.html> and L<http://www.faqs.org/rfcs/rfc1952.html> @@ -1492,7 +1492,7 @@ The primary site for gzip is L<http://www.gzip.org>. =head1 AUTHOR -This module was written by Paul Marquess, C<pmqs@cpan.org>. +This module was written by Paul Marquess, C<pmqs@cpan.org>. =head1 MODIFICATION HISTORY @@ -1500,7 +1500,7 @@ See the Changes file. =head1 COPYRIGHT AND LICENSE -Copyright (c) 1995-2017 Paul Marquess. All rights reserved. +Copyright (c) 1995-2018 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/File/GlobMapper.pm b/cpan/IO-Compress/lib/File/GlobMapper.pm index a96cf3e832..a4e5385565 100644 --- a/cpan/IO-Compress/lib/File/GlobMapper.pm +++ b/cpan/IO-Compress/lib/File/GlobMapper.pm @@ -9,24 +9,24 @@ our ($CSH_GLOB); BEGIN { if ($] < 5.006) - { + { require File::BSDGlob; import File::BSDGlob qw(:glob) ; $CSH_GLOB = File::BSDGlob::GLOB_CSH() ; *globber = \&File::BSDGlob::csh_glob; - } + } else - { + { require File::Glob; import File::Glob qw(:glob) ; $CSH_GLOB = File::Glob::GLOB_CSH() ; #*globber = \&File::Glob::bsd_glob; *globber = \&File::Glob::csh_glob; - } + } } our ($Error); our ($VERSION, @EXPORT_OK); -$VERSION = '1.000'; +$VERSION = '1.001'; @EXPORT_OK = qw( globmap ); @@ -44,7 +44,7 @@ $matchMetaRE = '[' . quotemeta($metachars) . ']'; ')' => ')', ); -%wildCount = map { $_ => 1 } qw/ * ? . { ( [ /; +%wildCount = map { $_ => 1 } qw/ * ? . { ( [ /; sub globmap ($$;) { @@ -88,7 +88,7 @@ sub new $self->_parseOutputGlob() or return undef ; - + my @inputFiles = globber($self->{InputGlob}, $flags) ; if (GLOB_ERROR) @@ -148,18 +148,18 @@ sub _parseBit ++ $self->{WildCount} if $wildCount{$2} ; if ($2 eq ',') - { + { return _unmatched("(") if $depth ; - + $out .= '|'; } elsif ($2 eq '(') - { + { ++ $depth ; } elsif ($2 eq ')') - { + { return _unmatched(")") if ! $depth ; @@ -214,11 +214,11 @@ sub _parseInputGlob ++ $self->{WildCount} if $wildCount{$2} ; if ($2 eq '(') - { + { ++ $depth ; } elsif ($2 eq ')') - { + { return _unmatched(")") if ! $depth ; @@ -252,8 +252,8 @@ sub _parseInputGlob } #$string =~ s#(.*?)\}##; - #my $alt = join '|', - # map { quotemeta $_ } + #my $alt = join '|', + # map { quotemeta $_ } # split "$noPreBS,", $1 ; my $alt = $self->_parseBit($1); defined $alt or return 0 ; @@ -426,7 +426,7 @@ Below is a possible implementation of a script to carry out the rename my $new = $old; $new =~ s#(.*)\.tar\.gz$#$1.tgz# ; - rename $old => $new + rename $old => $new or die "Cannot rename '$old' to '$new': $!\n; } @@ -439,14 +439,14 @@ has already done a lot of the hard work in pattern matching the filenames, wouldn't it be handy to be able to use the patterns in the fileglob to drive the new filename? -Well, that's I<exactly> what C<File::GlobMapper> does. +Well, that's I<exactly> what C<File::GlobMapper> does. Here is same snippet of code rewritten using C<globmap> for my $pair (globmap '<*.tar.gz>' => '<#1.tgz>' ) { my ($from, $to) = @$pair; - rename $from => $to + rename $from => $to or die "Cannot rename '$old' to '$new': $!\n; } @@ -454,7 +454,7 @@ So how does it work? Behind the scenes the C<globmap> function does a combination of a file glob to match existing filenames followed by a substitute -to create the new filenames. +to create the new filenames. Notice how both parameters to C<globmap> are strings that are delimited by <>. This is done to make them look more like file globs - it is just syntactic @@ -463,7 +463,7 @@ distinctive. The enclosing <> are optional, so you don't have to use them - in fact the first thing globmap will do is remove these delimiters if they are present. -The first parameter to C<globmap>, C<*.tar.gz>, is an I<Input File Glob>. +The first parameter to C<globmap>, C<*.tar.gz>, is an I<Input File Glob>. Once the enclosing "< ... >" is removed, this is passed (more or less) unchanged to C<File::Glob> to carry out a file match. @@ -472,7 +472,7 @@ full Perl regular expression, with the additional step of wrapping each transformed wildcard metacharacter sequence in parenthesis. In this case the input fileglob C<*.tar.gz> will be transformed into -this Perl regular expression +this Perl regular expression ([^/]*)\.tar\.gz @@ -598,9 +598,9 @@ filename matched by the input file glob. So *.c *.Z -The second is +The second is -Output FileGlobs take the +Output FileGlobs take the =over 5 @@ -610,7 +610,7 @@ The "*" character will be replaced with the complete input filename. =item #1 -Patterns of the form /#\d/ will be replaced with the +Patterns of the form /#\d/ will be replaced with the =back @@ -645,7 +645,7 @@ source and destination filenames. Here is an example that renames all c files to cpp. - + $ rename '*.c' '#1.cpp' =head2 A few example globmaps @@ -656,7 +656,7 @@ To copy all your .c file to a backup directory '</my/home/*.c>' '</my/backup/#1.c>' -If you want to compress all +If you want to compress all '</my/home/*.[ch]>' '<*.gz>' diff --git a/cpan/IO-Compress/lib/IO/Compress/Adapter/Bzip2.pm b/cpan/IO-Compress/lib/IO/Compress/Adapter/Bzip2.pm index 99773e8160..7b30c60138 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.074 qw(:Status); +use IO::Compress::Base::Common 2.081 qw(:Status); -use Compress::Raw::Bzip2 2.074 ; +use Compress::Raw::Bzip2 2.081 ; our ($VERSION); -$VERSION = '2.074'; +$VERSION = '2.081'; 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 1edd3fa62a..463c0e1b15 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.074 qw(:Status); -use Compress::Raw::Zlib 2.074 qw( !crc32 !adler32 ) ; +use IO::Compress::Base::Common 2.081 qw(:Status); +use Compress::Raw::Zlib 2.081 qw( !crc32 !adler32 ) ; require Exporter; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, @EXPORT, %DEFLATE_CONSTANTS); -$VERSION = '2.074'; +$VERSION = '2.081'; @ISA = qw(Exporter); @EXPORT_OK = @Compress::Raw::Zlib::DEFLATE_CONSTANTS; %EXPORT_TAGS = %Compress::Raw::Zlib::DEFLATE_CONSTANTS; diff --git a/cpan/IO-Compress/lib/IO/Compress/Adapter/Identity.pm b/cpan/IO-Compress/lib/IO/Compress/Adapter/Identity.pm index 71dee011ff..92bc093338 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.074 qw(:Status); +use IO::Compress::Base::Common 2.081 qw(:Status); our ($VERSION); -$VERSION = '2.074'; +$VERSION = '2.081'; sub mkCompObject { diff --git a/cpan/IO-Compress/lib/IO/Compress/Base.pm b/cpan/IO-Compress/lib/IO/Compress/Base.pm index 74eac6fba6..2f009966db 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.074 ; +use IO::Compress::Base::Common 2.081 ; use IO::File (); ; use Scalar::Util (); @@ -20,7 +20,7 @@ use Symbol(); our (@ISA, $VERSION); @ISA = qw(IO::File Exporter); -$VERSION = '2.074'; +$VERSION = '2.081'; #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. @@ -90,7 +90,7 @@ sub writeAt if (defined *$self->{FH}) { my $here = tell(*$self->{FH}); - return $self->saveErrorString(undef, "Cannot seek to end of output filehandle: $!", $!) + return $self->saveErrorString(undef, "Cannot seek to end of output filehandle: $!", $!) if $here < 0 ; seek(*$self->{FH}, $offset, IO::Handle::SEEK_SET) or return $self->saveErrorString(undef, "Cannot seek to end of output filehandle: $!", $!) ; @@ -120,7 +120,7 @@ sub output my $data = shift ; my $last = shift ; - return 1 + return 1 if length $data == 0 && ! $last ; if ( *$self->{FilterContainer} ) { @@ -131,7 +131,7 @@ sub output if (length $data) { if ( defined *$self->{FH} ) { defined *$self->{FH}->write( $data, length $data ) - or return $self->saveErrorString(0, $!, $!); + or return $self->saveErrorString(0, $!, $!); } else { ${ *$self->{Buffer} } .= $data ; @@ -157,7 +157,7 @@ our %PARAMS = ( 'filtercontainer' => [IO::Compress::Base::Common::Parse_code, undef], ); - + sub checkParams { my $self = shift ; @@ -171,9 +171,9 @@ sub checkParams $self->getExtraParams(), - *$self->{OneShot} ? $self->getOneShotParams() + *$self->{OneShot} ? $self->getOneShotParams() : (), - }, + }, @_) or $self->croakError("${class}: " . $got->getError()) ; return $got ; @@ -237,15 +237,15 @@ sub _create $obj->ckParams($got) or $obj->croakError("${class}: " . $obj->error()); - if ($got->getValue('encode')) { + if ($got->getValue('encode')) { my $want_encoding = $got->getValue('encode'); *$obj->{Encoding} = IO::Compress::Base::Common::getEncoding($obj, $class, $want_encoding); - my $x = *$obj->{Encoding}; + my $x = *$obj->{Encoding}; } else { - *$obj->{Encoding} = undef; + *$obj->{Encoding} = undef; } - + $obj->saveStatus(STATUS_OK) ; my $status ; @@ -253,7 +253,7 @@ sub _create { *$obj->{Compress} = $obj->mkComp($got) or return undef; - + *$obj->{UnCompSize} = new U64 ; *$obj->{CompSize} = new U64 ; @@ -274,14 +274,14 @@ sub _create } } - elsif ($outType eq 'filename') { + elsif ($outType eq 'filename') { no warnings; my $mode = '>' ; $mode = '>>' if $appendOutput; - *$obj->{FH} = new IO::File "$mode $outValue" + *$obj->{FH} = new IO::File "$mode $outValue" or return $obj->saveErrorString(undef, "cannot open file '$outValue': $!", $!) ; - *$obj->{StdIO} = ($outValue eq '-'); + *$obj->{StdIO} = ($outValue eq '-'); setBinModeOutput(*$obj->{FH}) ; } } @@ -307,7 +307,7 @@ sub _create return $obj ; } -sub ckOutputParam +sub ckOutputParam { my $self = shift ; my $from = shift ; @@ -321,15 +321,15 @@ sub ckOutputParam $self->croakError("$from: output buffer is read-only") if $outType eq 'buffer' && Scalar::Util::readonly(${ $_[0] }); - - return 1; + + return 1; } sub _def { my $obj = shift ; - + my $class= (caller)[0] ; my $name = (caller(1))[3] ; @@ -356,7 +356,7 @@ sub _def # { # while (my($k, $v) = each %$input) # { -# $v = \$input->{$k} +# $v = \$input->{$k} # unless defined $v ; # # $obj->_singleTarget($x, 1, $k, $v, @_) @@ -381,11 +381,11 @@ sub _def if (! $x->{oneOutput} ) { - my $inFile = ($x->{inType} eq 'filenames' + my $inFile = ($x->{inType} eq 'filenames' || $x->{inType} eq 'filename'); $x->{inType} = $inFile ? 'filename' : 'buffer'; - + foreach my $in ($x->{oneInput} ? $input : @$input) { my $out ; @@ -416,7 +416,7 @@ sub _singleTarget my $x = shift ; my $inputIsFilename = shift; my $input = shift; - + if ($x->{oneInput}) { $obj->getFileInfo($x->{Got}, $input) @@ -426,7 +426,7 @@ sub _singleTarget or return undef ; - defined $z->_wr2($input, $inputIsFilename) + defined $z->_wr2($input, $inputIsFilename) or return $z->closeError(undef) ; return $z->close() ; @@ -456,7 +456,7 @@ sub _singleTarget or return undef ; } - defined $obj->_wr2($element, $isFilename) + defined $obj->_wr2($element, $isFilename) or return $obj->closeError(undef) ; *$obj->{Got} = $keep->clone(); @@ -476,7 +476,7 @@ sub _wr2 my $input = $source ; if (! $inputIsFilename) { - $input = \$source + $input = \$source if ! ref $source; } @@ -503,16 +503,16 @@ sub _wr2 my $count = 0 ; while ($status = read($fh, $buff, 16 * 1024)) { $count += length $buff; - defined $self->syswrite($buff, @_) + defined $self->syswrite($buff, @_) or return undef ; } - return $self->saveErrorString(undef, $!, $!) + return $self->saveErrorString(undef, $!, $!) if ! defined $status ; if ( (!$isFilehandle || *$self->{AutoClose}) && $input ne '-') - { - $fh->close() + { + $fh->close() or return undef ; } @@ -555,7 +555,7 @@ sub TIEHANDLE return $_[0] if ref($_[0]); die "OOPS\n" ; } - + sub UNTIE { my $self = shift ; @@ -565,10 +565,10 @@ sub DESTROY { my $self = shift ; local ($., $@, $!, $^E, $?); - + $self->close() ; - # TODO - memory leak with 5.8.0 - this isn't called until + # TODO - memory leak with 5.8.0 - this isn't called until # global destruction # %{ *$self } = () ; @@ -603,7 +603,7 @@ sub syswrite if (@_ > 2) { $offset = $_[2] || 0; - $self->croakError(*$self->{ClassName} . "::write: offset outside string") + $self->croakError(*$self->{ClassName} . "::write: offset outside string") if $offset > $slen; if ($offset < 0) { $offset += $slen; @@ -617,20 +617,20 @@ sub syswrite } return 0 if (! defined $$buffer || length $$buffer == 0) && ! *$self->{FlushPending}; - + # *$self->{Pending} .= $$buffer ; -# +# # return length $$buffer # if (length *$self->{Pending} < 1024 * 16 && ! *$self->{FlushPending}) ; # -# $$buffer = *$self->{Pending} ; +# $$buffer = *$self->{Pending} ; # *$self->{Pending} = ''; - - if (*$self->{Encoding}) { + + if (*$self->{Encoding}) { $$buffer = *$self->{Encoding}->encode($$buffer); } else { - $] >= 5.008 and ( utf8::downgrade($$buffer, 1) + $] >= 5.008 and ( utf8::downgrade($$buffer, 1) or Carp::croak "Wide character in " . *$self->{ClassName} . "::write:"); } @@ -642,7 +642,7 @@ sub syswrite my $outBuffer=''; my $status = *$self->{Compress}->compr($buffer, $outBuffer) ; - return $self->saveErrorString(undef, *$self->{Compress}{Error}, + return $self->saveErrorString(undef, *$self->{Compress}{Error}, *$self->{Compress}{ErrorNo}) if $status == STATUS_ERROR; @@ -690,7 +690,7 @@ sub _flushCompressed my $outBuffer=''; my $status = *$self->{Compress}->flush($outBuffer, @_) ; - return $self->saveErrorString(0, *$self->{Compress}{Error}, + return $self->saveErrorString(0, *$self->{Compress}{Error}, *$self->{Compress}{ErrorNo}) if $status == STATUS_ERROR; @@ -702,19 +702,19 @@ sub _flushCompressed $self->outputPayload($outBuffer) or return 0; - return 1; + return 1; } sub flush -{ +{ my $self = shift ; $self->_flushCompressed(@_) - or return 0; + or return 0; if ( defined *$self->{FH} ) { defined *$self->{FH}->flush() - or return $self->saveErrorString(0, $!, $!); + or return $self->saveErrorString(0, $!, $!); } return 1; @@ -737,21 +737,21 @@ sub _newStream $self->ckParams($got) or $self->croakError("newStream: $self->{Error}"); - if ($got->getValue('encode')) { + if ($got->getValue('encode')) { my $want_encoding = $got->getValue('encode'); *$self->{Encoding} = IO::Compress::Base::Common::getEncoding($self, $class, $want_encoding); } else { *$self->{Encoding} = undef; } - + *$self->{Compress} = $self->mkComp($got) or return 0; *$self->{Header} = $self->mkHeader($got) ; $self->output(*$self->{Header} ) or return 0; - + *$self->{UnCompSize}->reset(); *$self->{CompSize}->reset(); @@ -763,9 +763,9 @@ sub _newStream sub newStream { my $self = shift ; - + my $got = $self->checkParams('newStream', *$self->{Got}, @_) - or return 0 ; + or return 0 ; $self->_newStream($got); @@ -775,7 +775,7 @@ sub newStream # *$self->{Header} = $self->mkHeader($got) ; # $self->output(*$self->{Header} ) # or return 0; -# +# # *$self->{UnCompSize}->reset(); # *$self->{CompSize}->reset(); # @@ -822,7 +822,7 @@ sub close return 1 if *$self->{Closed} || ! *$self->{Compress} ; *$self->{Closed} = 1 ; - untie *$self + untie *$self if $] >= 5.008 ; *$self->{FlushPending} = 1 ; @@ -840,7 +840,7 @@ sub close if ((! *$self->{Handle} || *$self->{AutoClose}) && ! *$self->{StdIO}) { $! = 0 ; *$self->{FH}->close() - or return $self->saveErrorString(0, $!, $!); + or return $self->saveErrorString(0, $!, $!); } delete *$self->{FH} ; # This delete can set $! in older Perls, so reset the errno @@ -924,7 +924,7 @@ sub seek } # short circuit if seeking to current offset - return 1 if $target == $here ; + return 1 if $target == $here ; # Outlaw any attempt to seek backwards $self->croakError(*$self->{ClassName} . "::seek: cannot seek backwards") @@ -944,16 +944,16 @@ sub binmode { 1; # my $self = shift ; -# return defined *$self->{FH} -# ? binmode *$self->{FH} +# return defined *$self->{FH} +# ? binmode *$self->{FH} # : 1 ; } sub fileno { my $self = shift ; - return defined *$self->{FH} - ? *$self->{FH}->fileno() + return defined *$self->{FH} + ? *$self->{FH}->fileno() : undef ; } @@ -966,8 +966,8 @@ sub opened sub autoflush { my $self = shift ; - return defined *$self->{FH} - ? *$self->{FH}->autoflush(@_) + return defined *$self->{FH} + ? *$self->{FH}->autoflush(@_) : undef ; } @@ -995,7 +995,7 @@ sub _notAvailable *PRINTF = \&printf; *WRITE = \&syswrite; *write = \&syswrite; -*SEEK = \&seek; +*SEEK = \&seek; *TELL = \&tell; *EOF = \&eof; *CLOSE = \&close; @@ -1004,13 +1004,13 @@ sub _notAvailable #*sysread = \&_notAvailable; #*syswrite = \&_write; -1; +1; __END__ =head1 NAME -IO::Compress::Base - Base Class for IO::Compress modules +IO::Compress::Base - Base Class for IO::Compress modules =head1 SYNOPSIS @@ -1033,7 +1033,7 @@ L<IO::Zlib|IO::Zlib> =head1 AUTHOR -This module was written by Paul Marquess, C<pmqs@cpan.org>. +This module was written by Paul Marquess, C<pmqs@cpan.org>. =head1 MODIFICATION HISTORY @@ -1041,7 +1041,7 @@ See the Changes file. =head1 COPYRIGHT AND LICENSE -Copyright (c) 2005-2017 Paul Marquess. All rights reserved. +Copyright (c) 2005-2018 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/IO/Compress/Base/Common.pm b/cpan/IO-Compress/lib/IO/Compress/Base/Common.pm index c82c99a441..bd260d5354 100644 --- a/cpan/IO-Compress/lib/IO/Compress/Base/Common.pm +++ b/cpan/IO-Compress/lib/IO/Compress/Base/Common.pm @@ -11,15 +11,15 @@ use File::GlobMapper; require Exporter; our ($VERSION, @ISA, @EXPORT, %EXPORT_TAGS, $HAS_ENCODE); @ISA = qw(Exporter); -$VERSION = '2.074'; +$VERSION = '2.081'; @EXPORT = qw( isaFilehandle isaFilename isaScalar - whatIsInput whatIsOutput + whatIsInput whatIsOutput isaFileGlobString cleanFileGlobString oneTarget setBinModeInput setBinModeOutput - ckInOutParams + ckInOutParams createSelfTiedObject - + isGeMax32 MAX32 @@ -33,7 +33,7 @@ $VERSION = '2.074'; STATUS_ENDSTREAM STATUS_EOF STATUS_ERROR - ); + ); %EXPORT_TAGS = ( Status => [qw( STATUS_OK STATUS_ENDSTREAM @@ -41,15 +41,15 @@ $VERSION = '2.074'; STATUS_ERROR )]); - + use constant STATUS_OK => 0; use constant STATUS_ENDSTREAM => 1; use constant STATUS_EOF => 2; use constant STATUS_ERROR => -1; -use constant MAX16 => 0xFFFF ; -use constant MAX32 => 0xFFFFFFFF ; -use constant MAX32cmp => 0xFFFFFFFF + 1 - 1; # for 5.6.x on 32-bit need to force an non-IV value - +use constant MAX16 => 0xFFFF ; +use constant MAX32 => 0xFFFFFFFF ; +use constant MAX32cmp => 0xFFFFFFFF + 1 - 1; # for 5.6.x on 32-bit need to force an non-IV value + sub isGeMax32 { @@ -89,7 +89,7 @@ sub getEncoding($$$) } our ($needBinmode); -$needBinmode = ($^O eq 'MSWin32' || +$needBinmode = ($^O eq 'MSWin32' || ($] >= 5.006 && eval ' ${^UNICODE} || ${^UTF8LOCALE} ')) ? 1 : 1 ; @@ -97,7 +97,7 @@ sub setBinModeInput($) { my $handle = shift ; - binmode $handle + binmode $handle if $needBinmode; } @@ -112,10 +112,10 @@ sub setBinModeOutput($) sub isaFilehandle($) { use utf8; # Pragma needed to keep Perl 5.6.0 happy - return (defined $_[0] and - (UNIVERSAL::isa($_[0],'GLOB') or + return (defined $_[0] and + (UNIVERSAL::isa($_[0],'GLOB') or UNIVERSAL::isa($_[0],'IO::Handle') or - UNIVERSAL::isa(\$_[0],'GLOB')) + UNIVERSAL::isa(\$_[0],'GLOB')) ) } @@ -126,8 +126,8 @@ sub isaScalar sub isaFilename($) { - return (defined $_[0] and - ! ref $_[0] and + return (defined $_[0] and + ! ref $_[0] and UNIVERSAL::isa(\$_[0], 'SCALAR')); } @@ -154,7 +154,7 @@ use constant WANT_HASH => 0 ; sub whatIsInput($;$) { my $got = whatIs(@_); - + if (defined $got && $got eq 'filename' && defined $_[0] && $_[0] eq '-') { #use IO::File; @@ -169,14 +169,14 @@ sub whatIsInput($;$) sub whatIsOutput($;$) { my $got = whatIs(@_); - + if (defined $got && $got eq 'filename' && defined $_[0] && $_[0] eq '-') { $got = 'handle'; $_[0] = *STDOUT; #$_[0] = new IO::File(">-"); } - + return $got; } @@ -218,9 +218,9 @@ sub IO::Compress::Base::Validator::new my $error_ref = shift ; my $reportClass = shift ; - my %data = (Class => $Class, + my %data = (Class => $Class, Error => $error_ref, - reportClass => $reportClass, + reportClass => $reportClass, ) ; my $obj = bless \%data, $class ; @@ -237,7 +237,7 @@ sub IO::Compress::Base::Validator::new { $obj->croakError("$reportClass: illegal input parameter") ; #return undef ; - } + } # if ($inType eq 'hash') # { @@ -250,18 +250,18 @@ sub IO::Compress::Base::Validator::new { $obj->croakError("$reportClass: illegal output parameter") ; #return undef ; - } + } if ($inType ne 'fileglob' && $outType eq 'fileglob') { $obj->croakError("Need input fileglob for outout fileglob"); - } + } # if ($inType ne 'fileglob' && $outType eq 'hash' && $inType ne 'filename' ) # { # $obj->croakError("input must ne filename or fileglob when output is a hash"); -# } +# } if ($inType eq 'fileglob' && $outType eq 'fileglob') { @@ -276,7 +276,7 @@ sub IO::Compress::Base::Validator::new return $obj; } - + $obj->croakError("$reportClass: input and output $inType are identical") if $inType eq $outType && $_[0] eq $_[1] && $_[0] ne '-' ; @@ -334,7 +334,7 @@ sub IO::Compress::Base::Validator::new } } } - + return $obj ; } @@ -343,7 +343,7 @@ sub IO::Compress::Base::Validator::saveErrorString my $self = shift ; ${ $self->{Error} } = shift ; return undef; - + } sub IO::Compress::Base::Validator::croakError @@ -392,16 +392,16 @@ sub IO::Compress::Base::Validator::validateInputArray if ( @{ $_[0] } == 0 ) { return $self->saveErrorString("empty array reference") ; - } + } foreach my $element ( @{ $_[0] } ) { my $inType = whatIsInput($element); - + if (! $inType) { $self->croakError("unknown input parameter") ; - } + } elsif($inType eq 'filename') { $self->validateInputFilenames($element) @@ -429,13 +429,13 @@ sub IO::Compress::Base::Validator::validateInputArray # if ($ktype ne 'filename') # { # return $self->saveErrorString("hash key not filename") ; -# } +# } # # my %valid = map { $_ => 1 } qw(filename buffer array undef handle) ; # if (! $valid{$vtype}) # { # return $self->saveErrorString("hash value not ok") ; -# } +# } # } # # return $self ; @@ -467,13 +467,13 @@ sub createSelfTiedObject #$VERSION = '2.000_08'; #@ISA = qw(Exporter); -$EXPORT_TAGS{Parse} = [qw( ParseParameters - Parse_any Parse_unsigned Parse_signed +$EXPORT_TAGS{Parse} = [qw( ParseParameters + Parse_any Parse_unsigned Parse_signed Parse_boolean Parse_string Parse_code Parse_writable_scalar ) - ]; + ]; push @EXPORT, @{ $EXPORT_TAGS{Parse} } ; @@ -501,15 +501,15 @@ use constant IxGot => 1 ; sub ParseParameters { - my $level = shift || 0 ; + my $level = shift || 0 ; my $sub = (caller($level + 1))[3] ; local $Carp::CarpLevel = 1 ; - + return $_[1] if @_ == 2 && defined $_[1] && UNIVERSAL::isa($_[1], "IO::Compress::Base::Parameters"); - - my $p = new IO::Compress::Base::Parameters() ; + + my $p = new IO::Compress::Base::Parameters() ; $p->parse(@_) or croak "$sub: $p->[IxError]" ; @@ -527,7 +527,7 @@ sub Init { my $default = shift ; my %got ; - + my $obj = IO::Compress::Base::Parameters::new(); while (my ($key, $v) = each %$default) { @@ -538,7 +538,7 @@ sub Init # my ($first_only, $sticky, $type, $value) = @$v ; my $sticky = 0; my $x ; - $obj->_checkType($key, \$value, $type, 0, \$x) + $obj->_checkType($key, \$value, $type, 0, \$x) or return undef ; $key = lc $key; @@ -548,12 +548,12 @@ sub Init # if $type & Parse_multiple; # $got{$key} = [0, $type, $value, $x, $first_only, $sticky] ; - $got{$key} = [0, $type, $value, $x] ; + $got{$key} = [0, $type, $value, $x] ; # } # # $got{$key}[OFF_PARSED] = 0 ; } - + return bless \%got, "IO::Compress::Base::Parameters::Defaults" ; } @@ -563,7 +563,7 @@ sub IO::Compress::Base::Parameters::new my $obj; $obj->[IxError] = ''; - $obj->[IxGot] = {} ; + $obj->[IxGot] = {} ; return bless $obj, 'IO::Compress::Base::Parameters' ; } @@ -578,13 +578,13 @@ sub IO::Compress::Base::Parameters::setError $self->[IxError] = $error ; return $retval; } - + sub IO::Compress::Base::Parameters::getError { my $self = shift ; return $self->[IxError] ; } - + sub IO::Compress::Base::Parameters::parse { my $self = shift ; @@ -603,21 +603,21 @@ sub IO::Compress::Base::Parameters::parse } elsif (@_ == 1) { my $href = $_[0] ; - + return $self->setError("Expected even number of parameters, got 1") if ! defined $href or ! ref $href or ref $href ne "HASH" ; - + foreach my $key (keys %$href) { push @entered, $key ; push @entered, \$href->{$key} ; } } else { - + my $count = @_; return $self->setError("Expected even number of parameters, got $count") if $count % 2 != 0 ; - + for my $i (0.. $count / 2 - 1) { push @entered, $_[2 * $i] ; push @entered, \$_[2 * $i + 1] ; @@ -626,22 +626,22 @@ sub IO::Compress::Base::Parameters::parse foreach my $key (keys %$default) { - + my ($type, $value) = @{ $default->{$key} } ; - - if ($firstTime) { - $got->{$key} = [0, $type, $value, $value] ; + + if ($firstTime) { + $got->{$key} = [0, $type, $value, $value] ; } else { - $got->{$key}[OFF_PARSED] = 0 ; - } + $got->{$key}[OFF_PARSED] = 0 ; + } } my %parsed = (); - - + + for my $i (0.. @entered / 2 - 1) { my $key = $entered[2* $i] ; my $value = $entered[2* $i+1] ; @@ -651,15 +651,15 @@ sub IO::Compress::Base::Parameters::parse $key =~ s/^-// ; my $canonkey = lc $key; - - if ($got->{$canonkey}) + + if ($got->{$canonkey}) { my $type = $got->{$canonkey}[OFF_TYPE] ; my $parsed = $parsed{$canonkey}; ++ $parsed{$canonkey}; - return $self->setError("Muliple instances of '$key' found") - if $parsed ; + return $self->setError("Muliple instances of '$key' found") + if $parsed ; my $s ; $self->_checkType($key, $value, $type, 1, \$s) @@ -672,7 +672,7 @@ sub IO::Compress::Base::Parameters::parse else { push (@Bad, $key) } } - + if (@Bad) { my ($bad) = join(", ", @Bad) ; return $self->setError("unknown key value(s) $bad") ; @@ -699,14 +699,14 @@ sub IO::Compress::Base::Parameters::_checkType return $self->setError("Parameter '$key' not writable") if readonly $$value ; - if (ref $$value) + if (ref $$value) { return $self->setError("Parameter '$key' not a scalar reference") if ref $$value ne 'SCALAR' ; $$output = $$value ; } - else + else { return $self->setError("Parameter '$key' not a scalar") if ref $value ne 'SCALAR' ; @@ -727,13 +727,13 @@ sub IO::Compress::Base::Parameters::_checkType } elsif ($type & Parse_unsigned) { - + return $self->setError("Parameter '$key' must be an unsigned int, got 'undef'") if ! defined $value ; return $self->setError("Parameter '$key' must be an unsigned int, got '$value'") if $value !~ /^\d+$/; - - $$output = defined $value ? $value : 0 ; + + $$output = defined $value ? $value : 0 ; return 1; } elsif ($type & Parse_signed) @@ -743,7 +743,7 @@ sub IO::Compress::Base::Parameters::_checkType return $self->setError("Parameter '$key' must be a signed int, got '$value'") if $value !~ /^-?\d+$/; - $$output = defined $value ? $value : 0 ; + $$output = defined $value ? $value : 0 ; return 1 ; } elsif ($type & Parse_boolean) @@ -751,13 +751,13 @@ sub IO::Compress::Base::Parameters::_checkType return $self->setError("Parameter '$key' must be an int, got '$value'") if defined $value && $value !~ /^\d*$/; - $$output = defined $value && $value != 0 ? 1 : 0 ; + $$output = defined $value && $value != 0 ? 1 : 0 ; return 1; } elsif ($type & Parse_string) { - $$output = defined $value ? $value : "" ; + $$output = defined $value ? $value : "" ; return 1; } elsif ($type & Parse_code) @@ -765,10 +765,10 @@ sub IO::Compress::Base::Parameters::_checkType return $self->setError("Parameter '$key' must be a code reference, got '$value'") if (! defined $value || ref $value ne 'CODE') ; - $$output = defined $value ? $value : "" ; + $$output = defined $value ? $value : "" ; return 1; } - + $$output = $value ; return 1; } @@ -787,7 +787,7 @@ sub IO::Compress::Base::Parameters::setValue { $_[0]->[IxGot]{$_[1]}[OFF_PARSED] = 1; $_[0]->[IxGot]{$_[1]}[OFF_DEFAULT] = $_[2] ; - $_[0]->[IxGot]{$_[1]}[OFF_FIXED] = $_[2] ; + $_[0]->[IxGot]{$_[1]}[OFF_FIXED] = $_[2] ; } sub IO::Compress::Base::Parameters::valueRef @@ -802,7 +802,7 @@ sub IO::Compress::Base::Parameters::valueOrDefault my $default = shift ; my $value = $self->[IxGot]{$name}[OFF_DEFAULT] ; - + return $value if defined $value ; return $default ; } @@ -841,12 +841,12 @@ sub new { return bless [ 0, 0 ], $_[0] if @_ == 1 ; - + return bless [ $_[1], 0 ], $_[0] if @_ == 2 ; - - return bless [ $_[2], $_[1] ], $_[0] - if @_ == 3 ; + + return bless [ $_[2], $_[1] ], $_[0] + if @_ == 3 ; } sub newUnpack_V64 @@ -870,7 +870,7 @@ sub reset sub clone { - bless [ @{$_[0]} ], ref $_[0] ; + bless [ @{$_[0]} ], ref $_[0] ; } sub getHigh @@ -904,13 +904,13 @@ sub add $_[0]->[HIGH] += $value->[HIGH] ; $value = $value->[LOW]; } - elsif ($value > MAX32) { + elsif ($value > MAX32) { $_[0]->[HIGH] += int($value / HI_1) ; $value = $value % HI_1; } - + my $available = MAX32 - $_[0]->[LOW] ; - + if ($value > $available) { ++ $_[0]->[HIGH] ; $_[0]->[LOW] = $value - $available - 1; @@ -925,13 +925,13 @@ sub add32 # my $self = shift; my $value = $_[1]; - if ($value > MAX32) { + if ($value > MAX32) { $_[0]->[HIGH] += int($value / HI_1) ; $value = $value % HI_1; } - + my $available = MAX32 - $_[0]->[LOW] ; - + if ($value > $available) { ++ $_[0]->[HIGH] ; $_[0]->[LOW] = $value - $available - 1; @@ -997,7 +997,7 @@ sub cmp return $self->[LOW] - $other->[LOW] ; } } - + sub is64bit { @@ -1025,7 +1025,7 @@ sub pack_V64 } -sub full32 +sub full32 { return $_[0] == MAX32 ; } diff --git a/cpan/IO-Compress/lib/IO/Compress/Bzip2.pm b/cpan/IO-Compress/lib/IO/Compress/Bzip2.pm index 5fa5f584d2..94a03f639e 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.074 ; +use IO::Compress::Base 2.081 ; -use IO::Compress::Base::Common 2.074 qw(); -use IO::Compress::Adapter::Bzip2 2.074 ; +use IO::Compress::Base::Common 2.081 qw(); +use IO::Compress::Adapter::Bzip2 2.081 ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $Bzip2Error); -$VERSION = '2.074'; +$VERSION = '2.081'; $Bzip2Error = ''; @ISA = qw(IO::Compress::Base Exporter); @@ -51,7 +51,7 @@ sub getExtraParams { my $self = shift ; - use IO::Compress::Base::Common 2.074 qw(:Parse); + use IO::Compress::Base::Common 2.081 qw(:Parse); return ( 'blocksize100k' => [IO::Compress::Base::Common::Parse_unsigned, 1], @@ -143,14 +143,12 @@ __END__ =head1 NAME IO::Compress::Bzip2 - Write bzip2 files/buffers - - =head1 SYNOPSIS use IO::Compress::Bzip2 qw(bzip2 $Bzip2Error) ; - my $status = bzip2 $input => $output [,OPTS] + my $status = bzip2 $input => $output [,OPTS] or die "bzip2 failed: $Bzip2Error\n"; my $z = new IO::Compress::Bzip2 $output [,OPTS] @@ -170,7 +168,7 @@ IO::Compress::Bzip2 - Write bzip2 files/buffers $z->autoflush(); $z->input_line_number(); $z->newStream( [OPTS] ); - + $z->close() ; $Bzip2Error ; @@ -185,14 +183,14 @@ IO::Compress::Bzip2 - Write bzip2 files/buffers binmode $z fileno $z close $z ; - + =head1 DESCRIPTION -This module provides a Perl interface that allows writing bzip2 +This module provides a Perl interface that allows writing bzip2 compressed data to files or buffer. -For reading bzip2 files/buffers, see the companion module +For reading bzip2 files/buffers, see the companion module L<IO::Uncompress::Bunzip2|IO::Uncompress::Bunzip2>. =head1 Functional Interface @@ -204,7 +202,7 @@ section. use IO::Compress::Bzip2 qw(bzip2 $Bzip2Error) ; - bzip2 $input_filename_or_reference => $output_filename_or_reference [,OPTS] + bzip2 $input_filename_or_reference => $output_filename_or_reference [,OPTS] or die "bzip2 failed: $Bzip2Error\n"; The functional interface needs Perl5.005 or better. @@ -217,7 +215,7 @@ C<$input_filename_or_reference> and C<$output_filename_or_reference>. =head3 The C<$input_filename_or_reference> parameter The parameter, C<$input_filename_or_reference>, is used to define the -source of the uncompressed data. +source of the uncompressed data. It can take one of the following forms: @@ -235,17 +233,17 @@ If the C<$input_filename_or_reference> parameter is a filehandle, the input data will be read from it. The string '-' can be used as an alias for standard input. -=item A scalar reference +=item A scalar reference If C<$input_filename_or_reference> is a scalar reference, the input data will be read from C<$$input_filename_or_reference>. -=item An array reference +=item An array reference If C<$input_filename_or_reference> is an array reference, each element in the array must be a filename. -The input data will be read from each file in turn. +The input data will be read from each file in turn. The complete array will be walked to ensure that it only contains valid filenames before any data is compressed. @@ -253,8 +251,8 @@ contains valid filenames before any data is compressed. =item An Input FileGlob string If C<$input_filename_or_reference> is a string that is delimited by the -characters "<" and ">" C<bzip2> will assume that it is an -I<input fileglob string>. The input is the list of files that match the +characters "<" and ">" C<bzip2> will assume that it is an +I<input fileglob string>. The input is the list of files that match the fileglob. See L<File::GlobMapper|File::GlobMapper> for more details. @@ -275,7 +273,7 @@ these forms. =item A filename If the C<$output_filename_or_reference> parameter is a simple scalar, it is -assumed to be a filename. This file will be opened for writing and the +assumed to be a filename. This file will be opened for writing and the compressed data will be written to it. =item A filehandle @@ -284,14 +282,14 @@ If the C<$output_filename_or_reference> parameter is a filehandle, the compressed data will be written to it. The string '-' can be used as an alias for standard output. -=item A scalar reference +=item A scalar reference If C<$output_filename_or_reference> is a scalar reference, the compressed data will be stored in C<$$output_filename_or_reference>. =item An Array Reference -If C<$output_filename_or_reference> is an array reference, +If C<$output_filename_or_reference> is an array reference, the compressed data will be pushed onto the array. =item An Output FileGlob @@ -329,7 +327,7 @@ L</"Constructor Options"> section below. =item C<< AutoClose => 0|1 >> -This option applies to any input or output data streams to +This option applies to any input or output data streams to C<bzip2> that are filehandles. If C<AutoClose> is specified, and the value is true, it will result in all @@ -371,7 +369,7 @@ written to it. Otherwise the file pointer will not be moved. =back -When C<Append> is specified, and set to true, it will I<append> all compressed +When C<Append> is specified, and set to true, it will I<append> all compressed data to the output data stream. So when the output is a filehandle it will carry out a seek to the eof @@ -415,7 +413,7 @@ compressed data to a buffer, C<$buffer>. my $input = new IO::File "<file1.txt" or die "Cannot open 'file1.txt': $!\n" ; my $buffer ; - bzip2 $input => \$buffer + bzip2 $input => \$buffer or die "bzip2 failed: $Bzip2Error\n"; To compress all files in the directory "/my/home" that match "*.txt" @@ -437,7 +435,7 @@ and if you want to compress each file one at a time, this will do the trick for my $input ( glob "/my/home/*.txt" ) { my $output = "$input.bz2" ; - bzip2 $input => $output + bzip2 $input => $output or die "Error compressing '$input': $Bzip2Error\n"; } @@ -450,14 +448,14 @@ The format of the constructor for C<IO::Compress::Bzip2> is shown below my $z = new IO::Compress::Bzip2 $output [,OPTS] or die "IO::Compress::Bzip2 failed: $Bzip2Error\n"; -It returns an C<IO::Compress::Bzip2> object on success and undef on failure. +It returns an C<IO::Compress::Bzip2> object on success and undef on failure. The variable C<$Bzip2Error> will contain an error message on failure. -If you are running Perl 5.005 or better the object, C<$z>, returned from -IO::Compress::Bzip2 can be used exactly like an L<IO::File|IO::File> filehandle. -This means that all normal output file operations can be carried out -with C<$z>. -For example, to write to a compressed file/buffer you can use either of +If you are running Perl 5.005 or better the object, C<$z>, returned from +IO::Compress::Bzip2 can be used exactly like an L<IO::File|IO::File> filehandle. +This means that all normal output file operations can be carried out +with C<$z>. +For example, to write to a compressed file/buffer you can use either of these forms $z->print("hello world\n"); @@ -480,7 +478,7 @@ If the C<$output> parameter is a filehandle, the compressed data will be written to it. The string '-' can be used as an alias for standard output. -=item A scalar reference +=item A scalar reference If C<$output> is a scalar reference, the compressed data will be stored in C<$$output>. @@ -507,7 +505,7 @@ This parameter defaults to 0. =item C<< Append => 0|1 >> -Opens C<$output> in append mode. +Opens C<$output> in append mode. The behaviour of this option is dependent on the type of C<$output>. @@ -537,7 +535,7 @@ This parameter defaults to 0. =item C<< BlockSize100K => number >> -Specify the number of 100K blocks bzip2 uses during compression. +Specify the number of 100K blocks bzip2 uses during compression. Valid values are from 1 to 9, where 9 is best compression. @@ -562,7 +560,7 @@ This is a placeholder option. TODO -=head1 Methods +=head1 Methods =head2 print @@ -672,7 +670,7 @@ This is a noop provided for completeness. $z->opened() -Returns true if the object currently refers to a opened file/buffer. +Returns true if the object currently refers to a opened file/buffer. =head2 autoflush @@ -695,7 +693,7 @@ retrieve the autoflush setting. $z->input_line_number() $z->input_line_number(EXPR) -This method always returns C<undef> when compressing. +This method always returns C<undef> when compressing. =head2 fileno @@ -714,7 +712,7 @@ C<undef>. $z->close() ; close $z ; -Flushes any pending compressed data and then closes the output file/buffer. +Flushes any pending compressed data and then closes the output file/buffer. For most versions of Perl this method will be automatically invoked if the IO::Compress::Bzip2 object is destroyed (either explicitly or by the @@ -747,9 +745,9 @@ the C<$z> object. See the L</"Constructor Options"> section for more details. -=head1 Importing +=head1 Importing -No symbolic constants are required by this IO::Compress::Bzip2 at present. +No symbolic constants are required by this IO::Compress::Bzip2 at present. =over 5 @@ -760,8 +758,6 @@ Same as doing this use IO::Compress::Bzip2 qw(bzip2 $Bzip2Error) ; - - =back =head1 EXAMPLES @@ -790,7 +786,7 @@ See the module L<Compress::Bzip2|Compress::Bzip2> =head1 AUTHOR -This module was written by Paul Marquess, C<pmqs@cpan.org>. +This module was written by Paul Marquess, C<pmqs@cpan.org>. =head1 MODIFICATION HISTORY @@ -798,7 +794,7 @@ See the Changes file. =head1 COPYRIGHT AND LICENSE -Copyright (c) 2005-2017 Paul Marquess. All rights reserved. +Copyright (c) 2005-2018 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/IO/Compress/Deflate.pm b/cpan/IO-Compress/lib/IO/Compress/Deflate.pm index 379ad9cd73..5e5c37c96a 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.074 (); -use IO::Compress::Adapter::Deflate 2.074 ; +use IO::Compress::RawDeflate 2.081 (); +use IO::Compress::Adapter::Deflate 2.081 ; -use IO::Compress::Zlib::Constants 2.074 ; -use IO::Compress::Base::Common 2.074 qw(); +use IO::Compress::Zlib::Constants 2.081 ; +use IO::Compress::Base::Common 2.081 qw(); our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $DeflateError); -$VERSION = '2.074'; +$VERSION = '2.081'; $DeflateError = ''; @ISA = qw(IO::Compress::RawDeflate Exporter); @@ -170,14 +170,12 @@ __END__ =head1 NAME IO::Compress::Deflate - Write RFC 1950 files/buffers - - =head1 SYNOPSIS use IO::Compress::Deflate qw(deflate $DeflateError) ; - my $status = deflate $input => $output [,OPTS] + my $status = deflate $input => $output [,OPTS] or die "deflate failed: $DeflateError\n"; my $z = new IO::Compress::Deflate $output [,OPTS] @@ -197,9 +195,9 @@ IO::Compress::Deflate - Write RFC 1950 files/buffers $z->autoflush(); $z->input_line_number(); $z->newStream( [OPTS] ); - + $z->deflateParams(); - + $z->close() ; $DeflateError ; @@ -214,14 +212,14 @@ IO::Compress::Deflate - Write RFC 1950 files/buffers binmode $z fileno $z close $z ; - + =head1 DESCRIPTION This module provides a Perl interface that allows writing compressed data to files or buffer as defined in RFC 1950. -For reading RFC 1950 files/buffers, see the companion module +For reading RFC 1950 files/buffers, see the companion module L<IO::Uncompress::Inflate|IO::Uncompress::Inflate>. =head1 Functional Interface @@ -233,7 +231,7 @@ section. use IO::Compress::Deflate qw(deflate $DeflateError) ; - deflate $input_filename_or_reference => $output_filename_or_reference [,OPTS] + deflate $input_filename_or_reference => $output_filename_or_reference [,OPTS] or die "deflate failed: $DeflateError\n"; The functional interface needs Perl5.005 or better. @@ -246,7 +244,7 @@ C<$input_filename_or_reference> and C<$output_filename_or_reference>. =head3 The C<$input_filename_or_reference> parameter The parameter, C<$input_filename_or_reference>, is used to define the -source of the uncompressed data. +source of the uncompressed data. It can take one of the following forms: @@ -264,17 +262,17 @@ If the C<$input_filename_or_reference> parameter is a filehandle, the input data will be read from it. The string '-' can be used as an alias for standard input. -=item A scalar reference +=item A scalar reference If C<$input_filename_or_reference> is a scalar reference, the input data will be read from C<$$input_filename_or_reference>. -=item An array reference +=item An array reference If C<$input_filename_or_reference> is an array reference, each element in the array must be a filename. -The input data will be read from each file in turn. +The input data will be read from each file in turn. The complete array will be walked to ensure that it only contains valid filenames before any data is compressed. @@ -282,8 +280,8 @@ contains valid filenames before any data is compressed. =item An Input FileGlob string If C<$input_filename_or_reference> is a string that is delimited by the -characters "<" and ">" C<deflate> will assume that it is an -I<input fileglob string>. The input is the list of files that match the +characters "<" and ">" C<deflate> will assume that it is an +I<input fileglob string>. The input is the list of files that match the fileglob. See L<File::GlobMapper|File::GlobMapper> for more details. @@ -304,7 +302,7 @@ these forms. =item A filename If the C<$output_filename_or_reference> parameter is a simple scalar, it is -assumed to be a filename. This file will be opened for writing and the +assumed to be a filename. This file will be opened for writing and the compressed data will be written to it. =item A filehandle @@ -313,14 +311,14 @@ If the C<$output_filename_or_reference> parameter is a filehandle, the compressed data will be written to it. The string '-' can be used as an alias for standard output. -=item A scalar reference +=item A scalar reference If C<$output_filename_or_reference> is a scalar reference, the compressed data will be stored in C<$$output_filename_or_reference>. =item An Array Reference -If C<$output_filename_or_reference> is an array reference, +If C<$output_filename_or_reference> is an array reference, the compressed data will be pushed onto the array. =item An Output FileGlob @@ -358,7 +356,7 @@ L</"Constructor Options"> section below. =item C<< AutoClose => 0|1 >> -This option applies to any input or output data streams to +This option applies to any input or output data streams to C<deflate> that are filehandles. If C<AutoClose> is specified, and the value is true, it will result in all @@ -400,7 +398,7 @@ written to it. Otherwise the file pointer will not be moved. =back -When C<Append> is specified, and set to true, it will I<append> all compressed +When C<Append> is specified, and set to true, it will I<append> all compressed data to the output data stream. So when the output is a filehandle it will carry out a seek to the eof @@ -444,7 +442,7 @@ compressed data to a buffer, C<$buffer>. my $input = new IO::File "<file1.txt" or die "Cannot open 'file1.txt': $!\n" ; my $buffer ; - deflate $input => \$buffer + deflate $input => \$buffer or die "deflate failed: $DeflateError\n"; To compress all files in the directory "/my/home" that match "*.txt" @@ -466,7 +464,7 @@ and if you want to compress each file one at a time, this will do the trick for my $input ( glob "/my/home/*.txt" ) { my $output = "$input.1950" ; - deflate $input => $output + deflate $input => $output or die "Error compressing '$input': $DeflateError\n"; } @@ -479,14 +477,14 @@ The format of the constructor for C<IO::Compress::Deflate> is shown below my $z = new IO::Compress::Deflate $output [,OPTS] or die "IO::Compress::Deflate failed: $DeflateError\n"; -It returns an C<IO::Compress::Deflate> object on success and undef on failure. +It returns an C<IO::Compress::Deflate> object on success and undef on failure. The variable C<$DeflateError> will contain an error message on failure. -If you are running Perl 5.005 or better the object, C<$z>, returned from -IO::Compress::Deflate can be used exactly like an L<IO::File|IO::File> filehandle. -This means that all normal output file operations can be carried out -with C<$z>. -For example, to write to a compressed file/buffer you can use either of +If you are running Perl 5.005 or better the object, C<$z>, returned from +IO::Compress::Deflate can be used exactly like an L<IO::File|IO::File> filehandle. +This means that all normal output file operations can be carried out +with C<$z>. +For example, to write to a compressed file/buffer you can use either of these forms $z->print("hello world\n"); @@ -509,7 +507,7 @@ If the C<$output> parameter is a filehandle, the compressed data will be written to it. The string '-' can be used as an alias for standard output. -=item A scalar reference +=item A scalar reference If C<$output> is a scalar reference, the compressed data will be stored in C<$$output>. @@ -536,7 +534,7 @@ This parameter defaults to 0. =item C<< Append => 0|1 >> -Opens C<$output> in append mode. +Opens C<$output> in append mode. The behaviour of this option is dependent on the type of C<$output>. @@ -568,20 +566,20 @@ This parameter defaults to 0. This option is used to compress input data and append it to an existing compressed data stream in C<$output>. The end result is a single compressed -data stream stored in C<$output>. +data stream stored in C<$output>. It is a fatal error to attempt to use this option when C<$output> is not an RFC 1950 data stream. There are a number of other limitations with the C<Merge> option: -=over 5 +=over 5 =item 1 This module needs to have been built with zlib 1.2.1 or better to work. A fatal error will be thrown if C<Merge> is used with an older version of -zlib. +zlib. =item 2 @@ -591,7 +589,7 @@ If C<$output> is a file or a filehandle, it must be seekable. This parameter defaults to 0. -=item -Level +=item -Level Defines the compression level used by zlib. The value should either be a number between 0 and 9 (0 means no compression and 9 is maximum @@ -610,7 +608,7 @@ Note, these constants are not imported by C<IO::Compress::Deflate> by default. use IO::Compress::Deflate qw(:constants); use IO::Compress::Deflate qw(:all); -=item -Strategy +=item -Strategy Defines the strategy used to tune the compression. Use one of the symbolic constants defined below. @@ -633,7 +631,7 @@ This is a placeholder option. TODO -=head1 Methods +=head1 Methods =head2 print @@ -751,7 +749,7 @@ This is a noop provided for completeness. $z->opened() -Returns true if the object currently refers to a opened file/buffer. +Returns true if the object currently refers to a opened file/buffer. =head2 autoflush @@ -774,7 +772,7 @@ retrieve the autoflush setting. $z->input_line_number() $z->input_line_number(EXPR) -This method always returns C<undef> when compressing. +This method always returns C<undef> when compressing. =head2 fileno @@ -793,7 +791,7 @@ C<undef>. $z->close() ; close $z ; -Flushes any pending compressed data and then closes the output file/buffer. +Flushes any pending compressed data and then closes the output file/buffer. For most versions of Perl this method will be automatically invoked if the IO::Compress::Deflate object is destroyed (either explicitly or by the @@ -834,9 +832,9 @@ Usage is TODO -=head1 Importing +=head1 Importing -A number of symbolic constants are required by some methods in +A number of symbolic constants are required by some methods in C<IO::Compress::Deflate>. None are imported by default. =over 5 @@ -884,9 +882,6 @@ These symbolic constants are used by the C<Strategy> option in the constructor. Z_FIXED Z_DEFAULT_STRATEGY - - - =back =head1 EXAMPLES @@ -909,7 +904,7 @@ L<File::GlobMapper|File::GlobMapper>, L<Archive::Zip|Archive::Zip>, L<Archive::Tar|Archive::Tar>, L<IO::Zlib|IO::Zlib> -For RFC 1950, 1951 and 1952 see +For RFC 1950, 1951 and 1952 see L<http://www.faqs.org/rfcs/rfc1950.html>, L<http://www.faqs.org/rfcs/rfc1951.html> and L<http://www.faqs.org/rfcs/rfc1952.html> @@ -924,7 +919,7 @@ The primary site for gzip is L<http://www.gzip.org>. =head1 AUTHOR -This module was written by Paul Marquess, C<pmqs@cpan.org>. +This module was written by Paul Marquess, C<pmqs@cpan.org>. =head1 MODIFICATION HISTORY @@ -932,7 +927,7 @@ See the Changes file. =head1 COPYRIGHT AND LICENSE -Copyright (c) 2005-2017 Paul Marquess. All rights reserved. +Copyright (c) 2005-2018 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/IO/Compress/FAQ.pod b/cpan/IO-Compress/lib/IO/Compress/FAQ.pod index 7099418443..cfd6ca38e0 100644 --- a/cpan/IO-Compress/lib/IO/Compress/FAQ.pod +++ b/cpan/IO-Compress/lib/IO/Compress/FAQ.pod @@ -7,7 +7,7 @@ IO::Compress::FAQ -- Frequently Asked Questions about IO::Compress Common questions answered. -=head1 GENERAL +=head1 GENERAL =head2 Compatibility with Unix compress/uncompress. @@ -104,7 +104,7 @@ recompression. my $gunzip = new IO::Uncompress::Gunzip $gzipFile or die "Cannot gunzip $gzipFile: $GunzipError\n" ; - bzip2 $gunzip => $bzipFile + bzip2 $gunzip => $bzipFile or die "Cannot bzip2 to $bzipFile: $Bzip2Error\n" ; Note, there is a limitation of this technique. Some compression file @@ -146,16 +146,16 @@ Only supported if the C<IO-Compress-Lzma> module is installed. Yes, both the C<IO-Compress-Zip> and C<IO-Uncompress-Unzip> modules support the zip feature called I<Zip64>. That allows them to read/write -files/buffers larger than 4Gig. +files/buffers larger than 4Gig. If you are creating a Zip file using the one-shot interface, and any of the input files is greater than 4Gig, a zip64 complaint zip file will be -created. +created. zip "really-large-file" => "my.zip"; Similarly with the one-shot interface, if the input is a buffer larger than -4 Gig, a zip64 complaint zip file will be created. +4 Gig, a zip64 complaint zip file will be created. zip \$really_large_buffer => "my.zip"; @@ -174,11 +174,11 @@ detect if the zip file is zip64. If you intend to manipulate the Zip64 zip files created with C<IO-Compress-Zip> using an external zip/unzip, make sure that it supports -Zip64. +Zip64. In particular, if you are using Info-Zip you need to have zip version 3.x or better to update a Zip64 archive and unzip version 6.x to read a zip64 -archive. +archive. =head2 Can I write more that 64K entries is a Zip files? @@ -209,7 +209,7 @@ The example below illustrates this behaviour $ echo abc | gzip -c >x.gz $ echo def | gzip -c >>x.gz - $ gunzip -c x.gz + $ gunzip -c x.gz abc def @@ -287,7 +287,7 @@ By default C<IO::Uncompress::Bzip2> will only uncompress the first bzip2 data stream in a pbzip2 file. To uncompress the complete pbzip2 file you must include the C<MultiStream> option, like this. - bunzip2 $input => \$output, MultiStream => 1 + bunzip2 $input => \$output, MultiStream => 1 or die "bunzip2 failed: $Bunzip2Error\n"; =head1 HTTP & NETWORK @@ -334,7 +334,7 @@ L<http://perl.apache.org/docs/tutorials/tips/mod_perl_tricks/mod_perl_tricks.htm return bless { r => $r, crc => crc32(undef), d => $d, - l => 0 + l => 0 },$class; } @@ -474,7 +474,7 @@ read from the FTP Server. gunzip $retr_fh => $outFilename, AutoClose => 1 or die "Cannot uncompress '$compressed_file': $GunzipError\n"; -and this to compress a file as it is written to the FTP Server +and this to compress a file as it is written to the FTP Server use Net::FTP; use IO::Compress::Gzip qw(:all); @@ -492,13 +492,13 @@ file/buffer and you want to read both. As an example consider the structure of a zip file. This is a well-defined file format that mixes both compressed and uncompressed sections of data in -a single file. +a single file. For the purposes of this discussion you can think of a zip file as sequence of compressed data streams, each of which is prefixed by an uncompressed local header. The local header contains information about the compressed data stream, including the name of the compressed file and, in particular, -the length of the compressed data stream. +the length of the compressed data stream. To illustrate how to use C<InputLength> here is a script that walks a zip file and prints out how many lines are in each compressed file (if you @@ -527,7 +527,7 @@ the other C<IO::Uncompress::*> modules. my $buffer; my $x ; - ($x = $fh->read($buffer, ZIP_LOCAL_HDR_LENGTH)) == ZIP_LOCAL_HDR_LENGTH + ($x = $fh->read($buffer, ZIP_LOCAL_HDR_LENGTH)) == ZIP_LOCAL_HDR_LENGTH or die "Truncated file: $!\n"; my $signature = unpack ("V", substr($buffer, 0, 4)); @@ -539,11 +539,11 @@ the other C<IO::Uncompress::*> modules. my $compressedMethod = unpack ("v", substr($buffer, 8, 2)); my $compressedLength = unpack ("V", substr($buffer, 18, 4)); my $uncompressedLength = unpack ("V", substr($buffer, 22, 4)); - my $filename_length = unpack ("v", substr($buffer, 26, 2)); + my $filename_length = unpack ("v", substr($buffer, 26, 2)); my $extra_length = unpack ("v", substr($buffer, 28, 2)); my $filename ; - $fh->read($filename, $filename_length) == $filename_length + $fh->read($filename, $filename_length) == $filename_length or die "Truncated file\n"; $fh->read($buffer, $extra_length) == $extra_length @@ -582,7 +582,7 @@ the other C<IO::Uncompress::*> modules. } The majority of the code above is concerned with reading the zip local -header data. The code that I want to focus on is at the bottom. +header data. The code that I want to focus on is at the bottom. while (1) { @@ -613,9 +613,9 @@ the C<$fh> filehandle (The only exception is for an error case like a truncated file or a corrupt data stream). This means that once RawInflate is finished C<$fh> will be left at the -byte directly after the compressed data stream. +byte directly after the compressed data stream. -Now consider what the code looks like without C<InputLength> +Now consider what the code looks like without C<InputLength> while (1) { @@ -654,7 +654,7 @@ application can cope with large compressed data streams. One final point -- obviously C<InputLength> can only be used whenever you know the length of the compressed data beforehand, like here with a zip -file. +file. =head1 SEE ALSO @@ -668,7 +668,7 @@ L<IO::Zlib|IO::Zlib> =head1 AUTHOR -This module was written by Paul Marquess, C<pmqs@cpan.org>. +This module was written by Paul Marquess, C<pmqs@cpan.org>. =head1 MODIFICATION HISTORY @@ -676,7 +676,7 @@ See the Changes file. =head1 COPYRIGHT AND LICENSE -Copyright (c) 2005-2017 Paul Marquess. All rights reserved. +Copyright (c) 2005-2018 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/IO/Compress/Gzip.pm b/cpan/IO-Compress/lib/IO/Compress/Gzip.pm index db01764624..53816871cf 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.074 () ; -use IO::Compress::Adapter::Deflate 2.074 ; +use IO::Compress::RawDeflate 2.081 () ; +use IO::Compress::Adapter::Deflate 2.081 ; -use IO::Compress::Base::Common 2.074 qw(:Status ); -use IO::Compress::Gzip::Constants 2.074 ; -use IO::Compress::Zlib::Extra 2.074 ; +use IO::Compress::Base::Common 2.081 qw(:Status ); +use IO::Compress::Gzip::Constants 2.081 ; +use IO::Compress::Zlib::Extra 2.081 ; BEGIN { @@ -25,7 +25,7 @@ BEGIN our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $GzipError); -$VERSION = '2.074'; +$VERSION = '2.081'; $GzipError = '' ; @ISA = qw(IO::Compress::RawDeflate Exporter); @@ -277,14 +277,12 @@ __END__ =head1 NAME IO::Compress::Gzip - Write RFC 1952 files/buffers - - =head1 SYNOPSIS use IO::Compress::Gzip qw(gzip $GzipError) ; - my $status = gzip $input => $output [,OPTS] + my $status = gzip $input => $output [,OPTS] or die "gzip failed: $GzipError\n"; my $z = new IO::Compress::Gzip $output [,OPTS] @@ -304,9 +302,9 @@ IO::Compress::Gzip - Write RFC 1952 files/buffers $z->autoflush(); $z->input_line_number(); $z->newStream( [OPTS] ); - + $z->deflateParams(); - + $z->close() ; $GzipError ; @@ -321,7 +319,7 @@ IO::Compress::Gzip - Write RFC 1952 files/buffers binmode $z fileno $z close $z ; - + =head1 DESCRIPTION @@ -331,7 +329,7 @@ data to files or buffer as defined in RFC 1952. All the gzip headers defined in RFC 1952 can be created using this module. -For reading RFC 1952 files/buffers, see the companion module +For reading RFC 1952 files/buffers, see the companion module L<IO::Uncompress::Gunzip|IO::Uncompress::Gunzip>. =head1 Functional Interface @@ -343,7 +341,7 @@ section. use IO::Compress::Gzip qw(gzip $GzipError) ; - gzip $input_filename_or_reference => $output_filename_or_reference [,OPTS] + gzip $input_filename_or_reference => $output_filename_or_reference [,OPTS] or die "gzip failed: $GzipError\n"; The functional interface needs Perl5.005 or better. @@ -356,7 +354,7 @@ C<$input_filename_or_reference> and C<$output_filename_or_reference>. =head3 The C<$input_filename_or_reference> parameter The parameter, C<$input_filename_or_reference>, is used to define the -source of the uncompressed data. +source of the uncompressed data. It can take one of the following forms: @@ -374,17 +372,17 @@ If the C<$input_filename_or_reference> parameter is a filehandle, the input data will be read from it. The string '-' can be used as an alias for standard input. -=item A scalar reference +=item A scalar reference If C<$input_filename_or_reference> is a scalar reference, the input data will be read from C<$$input_filename_or_reference>. -=item An array reference +=item An array reference If C<$input_filename_or_reference> is an array reference, each element in the array must be a filename. -The input data will be read from each file in turn. +The input data will be read from each file in turn. The complete array will be walked to ensure that it only contains valid filenames before any data is compressed. @@ -392,8 +390,8 @@ contains valid filenames before any data is compressed. =item An Input FileGlob string If C<$input_filename_or_reference> is a string that is delimited by the -characters "<" and ">" C<gzip> will assume that it is an -I<input fileglob string>. The input is the list of files that match the +characters "<" and ">" C<gzip> will assume that it is an +I<input fileglob string>. The input is the list of files that match the fileglob. See L<File::GlobMapper|File::GlobMapper> for more details. @@ -403,7 +401,7 @@ See L<File::GlobMapper|File::GlobMapper> for more details. If the C<$input_filename_or_reference> parameter is any other type, C<undef> will be returned. -In addition, if C<$input_filename_or_reference> is a simple filename, +In addition, if C<$input_filename_or_reference> is a simple filename, the default values for the C<Name> and C<Time> options will be sourced from that file. @@ -422,7 +420,7 @@ these forms. =item A filename If the C<$output_filename_or_reference> parameter is a simple scalar, it is -assumed to be a filename. This file will be opened for writing and the +assumed to be a filename. This file will be opened for writing and the compressed data will be written to it. =item A filehandle @@ -431,14 +429,14 @@ If the C<$output_filename_or_reference> parameter is a filehandle, the compressed data will be written to it. The string '-' can be used as an alias for standard output. -=item A scalar reference +=item A scalar reference If C<$output_filename_or_reference> is a scalar reference, the compressed data will be stored in C<$$output_filename_or_reference>. =item An Array Reference -If C<$output_filename_or_reference> is an array reference, +If C<$output_filename_or_reference> is an array reference, the compressed data will be pushed onto the array. =item An Output FileGlob @@ -476,7 +474,7 @@ L</"Constructor Options"> section below. =item C<< AutoClose => 0|1 >> -This option applies to any input or output data streams to +This option applies to any input or output data streams to C<gzip> that are filehandles. If C<AutoClose> is specified, and the value is true, it will result in all @@ -518,7 +516,7 @@ written to it. Otherwise the file pointer will not be moved. =back -When C<Append> is specified, and set to true, it will I<append> all compressed +When C<Append> is specified, and set to true, it will I<append> all compressed data to the output data stream. So when the output is a filehandle it will carry out a seek to the eof @@ -562,7 +560,7 @@ compressed data to a buffer, C<$buffer>. my $input = new IO::File "<file1.txt" or die "Cannot open 'file1.txt': $!\n" ; my $buffer ; - gzip $input => \$buffer + gzip $input => \$buffer or die "gzip failed: $GzipError\n"; To compress all files in the directory "/my/home" that match "*.txt" @@ -584,7 +582,7 @@ and if you want to compress each file one at a time, this will do the trick for my $input ( glob "/my/home/*.txt" ) { my $output = "$input.gz" ; - gzip $input => $output + gzip $input => $output or die "Error compressing '$input': $GzipError\n"; } @@ -597,14 +595,14 @@ The format of the constructor for C<IO::Compress::Gzip> is shown below my $z = new IO::Compress::Gzip $output [,OPTS] or die "IO::Compress::Gzip failed: $GzipError\n"; -It returns an C<IO::Compress::Gzip> object on success and undef on failure. +It returns an C<IO::Compress::Gzip> object on success and undef on failure. The variable C<$GzipError> will contain an error message on failure. -If you are running Perl 5.005 or better the object, C<$z>, returned from -IO::Compress::Gzip can be used exactly like an L<IO::File|IO::File> filehandle. -This means that all normal output file operations can be carried out -with C<$z>. -For example, to write to a compressed file/buffer you can use either of +If you are running Perl 5.005 or better the object, C<$z>, returned from +IO::Compress::Gzip can be used exactly like an L<IO::File|IO::File> filehandle. +This means that all normal output file operations can be carried out +with C<$z>. +For example, to write to a compressed file/buffer you can use either of these forms $z->print("hello world\n"); @@ -627,7 +625,7 @@ If the C<$output> parameter is a filehandle, the compressed data will be written to it. The string '-' can be used as an alias for standard output. -=item A scalar reference +=item A scalar reference If C<$output> is a scalar reference, the compressed data will be stored in C<$$output>. @@ -654,7 +652,7 @@ This parameter defaults to 0. =item C<< Append => 0|1 >> -Opens C<$output> in append mode. +Opens C<$output> in append mode. The behaviour of this option is dependent on the type of C<$output>. @@ -686,20 +684,20 @@ This parameter defaults to 0. This option is used to compress input data and append it to an existing compressed data stream in C<$output>. The end result is a single compressed -data stream stored in C<$output>. +data stream stored in C<$output>. It is a fatal error to attempt to use this option when C<$output> is not an RFC 1952 data stream. There are a number of other limitations with the C<Merge> option: -=over 5 +=over 5 =item 1 This module needs to have been built with zlib 1.2.1 or better to work. A fatal error will be thrown if C<Merge> is used with an older version of -zlib. +zlib. =item 2 @@ -709,7 +707,7 @@ If C<$output> is a file or a filehandle, it must be seekable. This parameter defaults to 0. -=item -Level +=item -Level Defines the compression level used by zlib. The value should either be a number between 0 and 9 (0 means no compression and 9 is maximum @@ -728,7 +726,7 @@ Note, these constants are not imported by C<IO::Compress::Gzip> by default. use IO::Compress::Gzip qw(:constants); use IO::Compress::Gzip qw(:all); -=item -Strategy +=item -Strategy Defines the strategy used to tune the compression. Use one of the symbolic constants defined below. @@ -747,7 +745,7 @@ If specified, this option will force the creation of the smallest possible compliant gzip header (which is exactly 10 bytes long) as defined in RFC 1952. -See the section titled "Compliance" in RFC 1952 for a definition +See the section titled "Compliance" in RFC 1952 for a definition of the values used for the fields in the gzip header. All other parameters that control the content of the gzip header will @@ -793,7 +791,7 @@ This parameter controls the setting of the FLG.FTEXT bit in the gzip header. It is used to signal that the data stored in the gzip file/buffer is probably text. -The default is 0. +The default is 0. =item C<< HeaderCRC => 0|1 >> @@ -879,12 +877,12 @@ If C<Strict> is enabled the following behaviour will be policed: =over 5 -=item * +=item * The value supplied with the C<Name> option can only contain ISO 8859-1 characters. -=item * +=item * The value supplied with the C<Comment> option can only contain ISO 8859-1 characters plus line-feed. @@ -894,12 +892,12 @@ characters plus line-feed. The values supplied with the C<-Name> and C<-Comment> options cannot contain multiple embedded nulls. -=item * +=item * If an C<ExtraField> option is specified and it is a simple scalar, it must conform to the sub-field structure as defined in RFC 1952. -=item * +=item * If an C<ExtraField> option is specified the second byte of the ID will be checked in each subfield to ensure that it does not contain the reserved @@ -911,12 +909,12 @@ When C<Strict> is disabled the following behaviour will be policed: =over 5 -=item * +=item * The value supplied with C<-Name> option can contain any character except NULL. -=item * +=item * The value supplied with C<-Comment> option can contain any character except NULL. @@ -928,12 +926,12 @@ multiple embedded nulls. The string written to the gzip header will consist of the characters up to, but not including, the first embedded NULL. -=item * +=item * If an C<ExtraField> option is specified and it is a simple scalar, the structure will not be checked. The only error is if the length is too big. -=item * +=item * The ID header in an C<ExtraField> sub-field can consist of any two bytes. @@ -945,7 +943,7 @@ The ID header in an C<ExtraField> sub-field can consist of any two bytes. TODO -=head1 Methods +=head1 Methods =head2 print @@ -1063,7 +1061,7 @@ This is a noop provided for completeness. $z->opened() -Returns true if the object currently refers to a opened file/buffer. +Returns true if the object currently refers to a opened file/buffer. =head2 autoflush @@ -1086,7 +1084,7 @@ retrieve the autoflush setting. $z->input_line_number() $z->input_line_number(EXPR) -This method always returns C<undef> when compressing. +This method always returns C<undef> when compressing. =head2 fileno @@ -1105,7 +1103,7 @@ C<undef>. $z->close() ; close $z ; -Flushes any pending compressed data and then closes the output file/buffer. +Flushes any pending compressed data and then closes the output file/buffer. For most versions of Perl this method will be automatically invoked if the IO::Compress::Gzip object is destroyed (either explicitly or by the @@ -1146,9 +1144,9 @@ Usage is TODO -=head1 Importing +=head1 Importing -A number of symbolic constants are required by some methods in +A number of symbolic constants are required by some methods in C<IO::Compress::Gzip>. None are imported by default. =over 5 @@ -1196,9 +1194,6 @@ These symbolic constants are used by the C<Strategy> option in the constructor. Z_FIXED Z_DEFAULT_STRATEGY - - - =back =head1 EXAMPLES @@ -1221,7 +1216,7 @@ L<File::GlobMapper|File::GlobMapper>, L<Archive::Zip|Archive::Zip>, L<Archive::Tar|Archive::Tar>, L<IO::Zlib|IO::Zlib> -For RFC 1950, 1951 and 1952 see +For RFC 1950, 1951 and 1952 see L<http://www.faqs.org/rfcs/rfc1950.html>, L<http://www.faqs.org/rfcs/rfc1951.html> and L<http://www.faqs.org/rfcs/rfc1952.html> @@ -1236,7 +1231,7 @@ The primary site for gzip is L<http://www.gzip.org>. =head1 AUTHOR -This module was written by Paul Marquess, C<pmqs@cpan.org>. +This module was written by Paul Marquess, C<pmqs@cpan.org>. =head1 MODIFICATION HISTORY @@ -1244,7 +1239,7 @@ See the Changes file. =head1 COPYRIGHT AND LICENSE -Copyright (c) 2005-2017 Paul Marquess. All rights reserved. +Copyright (c) 2005-2018 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/IO/Compress/Gzip/Constants.pm b/cpan/IO-Compress/lib/IO/Compress/Gzip/Constants.pm index 8186bf325e..733b1f7f1b 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.074'; +$VERSION = '2.081'; @ISA = qw(Exporter); diff --git a/cpan/IO-Compress/lib/IO/Compress/RawDeflate.pm b/cpan/IO-Compress/lib/IO/Compress/RawDeflate.pm index bc1b71eefe..8bbafc0029 100644 --- a/cpan/IO-Compress/lib/IO/Compress/RawDeflate.pm +++ b/cpan/IO-Compress/lib/IO/Compress/RawDeflate.pm @@ -6,15 +6,15 @@ use strict ; use warnings; use bytes; -use IO::Compress::Base 2.074 ; -use IO::Compress::Base::Common 2.074 qw(:Status ); -use IO::Compress::Adapter::Deflate 2.074 ; +use IO::Compress::Base 2.081 ; +use IO::Compress::Base::Common 2.081 qw(:Status ); +use IO::Compress::Adapter::Deflate 2.081 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %DEFLATE_CONSTANTS, %EXPORT_TAGS, $RawDeflateError); -$VERSION = '2.074'; +$VERSION = '2.081'; $RawDeflateError = ''; @ISA = qw(IO::Compress::Base Exporter); @@ -116,8 +116,8 @@ sub getExtraParams return getZlibParams(); } -use IO::Compress::Base::Common 2.074 qw(:Parse); -use Compress::Raw::Zlib 2.074 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY); +use IO::Compress::Base::Common 2.081 qw(:Parse); +use Compress::Raw::Zlib 2.081 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY); our %PARAMS = ( #'method' => [IO::Compress::Base::Common::Parse_unsigned, Z_DEFLATED], 'level' => [IO::Compress::Base::Common::Parse_signed, Z_DEFAULT_COMPRESSION], @@ -223,14 +223,12 @@ __END__ =head1 NAME IO::Compress::RawDeflate - Write RFC 1951 files/buffers - - =head1 SYNOPSIS use IO::Compress::RawDeflate qw(rawdeflate $RawDeflateError) ; - my $status = rawdeflate $input => $output [,OPTS] + my $status = rawdeflate $input => $output [,OPTS] or die "rawdeflate failed: $RawDeflateError\n"; my $z = new IO::Compress::RawDeflate $output [,OPTS] @@ -250,9 +248,9 @@ IO::Compress::RawDeflate - Write RFC 1951 files/buffers $z->autoflush(); $z->input_line_number(); $z->newStream( [OPTS] ); - + $z->deflateParams(); - + $z->close() ; $RawDeflateError ; @@ -267,7 +265,7 @@ IO::Compress::RawDeflate - Write RFC 1951 files/buffers binmode $z fileno $z close $z ; - + =head1 DESCRIPTION @@ -277,7 +275,7 @@ data to files or buffer as defined in RFC 1951. Note that RFC 1951 data is not a good choice of compression format to use in isolation, especially if you want to auto-detect it. -For reading RFC 1951 files/buffers, see the companion module +For reading RFC 1951 files/buffers, see the companion module L<IO::Uncompress::RawInflate|IO::Uncompress::RawInflate>. =head1 Functional Interface @@ -289,7 +287,7 @@ section. use IO::Compress::RawDeflate qw(rawdeflate $RawDeflateError) ; - rawdeflate $input_filename_or_reference => $output_filename_or_reference [,OPTS] + rawdeflate $input_filename_or_reference => $output_filename_or_reference [,OPTS] or die "rawdeflate failed: $RawDeflateError\n"; The functional interface needs Perl5.005 or better. @@ -302,7 +300,7 @@ C<$input_filename_or_reference> and C<$output_filename_or_reference>. =head3 The C<$input_filename_or_reference> parameter The parameter, C<$input_filename_or_reference>, is used to define the -source of the uncompressed data. +source of the uncompressed data. It can take one of the following forms: @@ -320,17 +318,17 @@ If the C<$input_filename_or_reference> parameter is a filehandle, the input data will be read from it. The string '-' can be used as an alias for standard input. -=item A scalar reference +=item A scalar reference If C<$input_filename_or_reference> is a scalar reference, the input data will be read from C<$$input_filename_or_reference>. -=item An array reference +=item An array reference If C<$input_filename_or_reference> is an array reference, each element in the array must be a filename. -The input data will be read from each file in turn. +The input data will be read from each file in turn. The complete array will be walked to ensure that it only contains valid filenames before any data is compressed. @@ -338,8 +336,8 @@ contains valid filenames before any data is compressed. =item An Input FileGlob string If C<$input_filename_or_reference> is a string that is delimited by the -characters "<" and ">" C<rawdeflate> will assume that it is an -I<input fileglob string>. The input is the list of files that match the +characters "<" and ">" C<rawdeflate> will assume that it is an +I<input fileglob string>. The input is the list of files that match the fileglob. See L<File::GlobMapper|File::GlobMapper> for more details. @@ -360,7 +358,7 @@ these forms. =item A filename If the C<$output_filename_or_reference> parameter is a simple scalar, it is -assumed to be a filename. This file will be opened for writing and the +assumed to be a filename. This file will be opened for writing and the compressed data will be written to it. =item A filehandle @@ -369,14 +367,14 @@ If the C<$output_filename_or_reference> parameter is a filehandle, the compressed data will be written to it. The string '-' can be used as an alias for standard output. -=item A scalar reference +=item A scalar reference If C<$output_filename_or_reference> is a scalar reference, the compressed data will be stored in C<$$output_filename_or_reference>. =item An Array Reference -If C<$output_filename_or_reference> is an array reference, +If C<$output_filename_or_reference> is an array reference, the compressed data will be pushed onto the array. =item An Output FileGlob @@ -414,7 +412,7 @@ L</"Constructor Options"> section below. =item C<< AutoClose => 0|1 >> -This option applies to any input or output data streams to +This option applies to any input or output data streams to C<rawdeflate> that are filehandles. If C<AutoClose> is specified, and the value is true, it will result in all @@ -456,7 +454,7 @@ written to it. Otherwise the file pointer will not be moved. =back -When C<Append> is specified, and set to true, it will I<append> all compressed +When C<Append> is specified, and set to true, it will I<append> all compressed data to the output data stream. So when the output is a filehandle it will carry out a seek to the eof @@ -500,7 +498,7 @@ compressed data to a buffer, C<$buffer>. my $input = new IO::File "<file1.txt" or die "Cannot open 'file1.txt': $!\n" ; my $buffer ; - rawdeflate $input => \$buffer + rawdeflate $input => \$buffer or die "rawdeflate failed: $RawDeflateError\n"; To compress all files in the directory "/my/home" that match "*.txt" @@ -522,7 +520,7 @@ and if you want to compress each file one at a time, this will do the trick for my $input ( glob "/my/home/*.txt" ) { my $output = "$input.1951" ; - rawdeflate $input => $output + rawdeflate $input => $output or die "Error compressing '$input': $RawDeflateError\n"; } @@ -535,14 +533,14 @@ The format of the constructor for C<IO::Compress::RawDeflate> is shown below my $z = new IO::Compress::RawDeflate $output [,OPTS] or die "IO::Compress::RawDeflate failed: $RawDeflateError\n"; -It returns an C<IO::Compress::RawDeflate> object on success and undef on failure. +It returns an C<IO::Compress::RawDeflate> object on success and undef on failure. The variable C<$RawDeflateError> will contain an error message on failure. -If you are running Perl 5.005 or better the object, C<$z>, returned from -IO::Compress::RawDeflate can be used exactly like an L<IO::File|IO::File> filehandle. -This means that all normal output file operations can be carried out -with C<$z>. -For example, to write to a compressed file/buffer you can use either of +If you are running Perl 5.005 or better the object, C<$z>, returned from +IO::Compress::RawDeflate can be used exactly like an L<IO::File|IO::File> filehandle. +This means that all normal output file operations can be carried out +with C<$z>. +For example, to write to a compressed file/buffer you can use either of these forms $z->print("hello world\n"); @@ -565,7 +563,7 @@ If the C<$output> parameter is a filehandle, the compressed data will be written to it. The string '-' can be used as an alias for standard output. -=item A scalar reference +=item A scalar reference If C<$output> is a scalar reference, the compressed data will be stored in C<$$output>. @@ -592,7 +590,7 @@ This parameter defaults to 0. =item C<< Append => 0|1 >> -Opens C<$output> in append mode. +Opens C<$output> in append mode. The behaviour of this option is dependent on the type of C<$output>. @@ -624,20 +622,20 @@ This parameter defaults to 0. This option is used to compress input data and append it to an existing compressed data stream in C<$output>. The end result is a single compressed -data stream stored in C<$output>. +data stream stored in C<$output>. It is a fatal error to attempt to use this option when C<$output> is not an RFC 1951 data stream. There are a number of other limitations with the C<Merge> option: -=over 5 +=over 5 =item 1 This module needs to have been built with zlib 1.2.1 or better to work. A fatal error will be thrown if C<Merge> is used with an older version of -zlib. +zlib. =item 2 @@ -647,7 +645,7 @@ If C<$output> is a file or a filehandle, it must be seekable. This parameter defaults to 0. -=item -Level +=item -Level Defines the compression level used by zlib. The value should either be a number between 0 and 9 (0 means no compression and 9 is maximum @@ -666,7 +664,7 @@ Note, these constants are not imported by C<IO::Compress::RawDeflate> by default use IO::Compress::RawDeflate qw(:constants); use IO::Compress::RawDeflate qw(:all); -=item -Strategy +=item -Strategy Defines the strategy used to tune the compression. Use one of the symbolic constants defined below. @@ -689,7 +687,7 @@ This is a placeholder option. TODO -=head1 Methods +=head1 Methods =head2 print @@ -807,7 +805,7 @@ This is a noop provided for completeness. $z->opened() -Returns true if the object currently refers to a opened file/buffer. +Returns true if the object currently refers to a opened file/buffer. =head2 autoflush @@ -830,7 +828,7 @@ retrieve the autoflush setting. $z->input_line_number() $z->input_line_number(EXPR) -This method always returns C<undef> when compressing. +This method always returns C<undef> when compressing. =head2 fileno @@ -849,7 +847,7 @@ C<undef>. $z->close() ; close $z ; -Flushes any pending compressed data and then closes the output file/buffer. +Flushes any pending compressed data and then closes the output file/buffer. For most versions of Perl this method will be automatically invoked if the IO::Compress::RawDeflate object is destroyed (either explicitly or by the @@ -890,9 +888,9 @@ Usage is TODO -=head1 Importing +=head1 Importing -A number of symbolic constants are required by some methods in +A number of symbolic constants are required by some methods in C<IO::Compress::RawDeflate>. None are imported by default. =over 5 @@ -940,9 +938,6 @@ These symbolic constants are used by the C<Strategy> option in the constructor. Z_FIXED Z_DEFAULT_STRATEGY - - - =back =head1 EXAMPLES @@ -965,7 +960,7 @@ L<File::GlobMapper|File::GlobMapper>, L<Archive::Zip|Archive::Zip>, L<Archive::Tar|Archive::Tar>, L<IO::Zlib|IO::Zlib> -For RFC 1950, 1951 and 1952 see +For RFC 1950, 1951 and 1952 see L<http://www.faqs.org/rfcs/rfc1950.html>, L<http://www.faqs.org/rfcs/rfc1951.html> and L<http://www.faqs.org/rfcs/rfc1952.html> @@ -980,7 +975,7 @@ The primary site for gzip is L<http://www.gzip.org>. =head1 AUTHOR -This module was written by Paul Marquess, C<pmqs@cpan.org>. +This module was written by Paul Marquess, C<pmqs@cpan.org>. =head1 MODIFICATION HISTORY @@ -988,7 +983,7 @@ See the Changes file. =head1 COPYRIGHT AND LICENSE -Copyright (c) 2005-2017 Paul Marquess. All rights reserved. +Copyright (c) 2005-2018 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/IO/Compress/Zip.pm b/cpan/IO-Compress/lib/IO/Compress/Zip.pm index 07c72d6706..16ba68944d 100644 --- a/cpan/IO-Compress/lib/IO/Compress/Zip.pm +++ b/cpan/IO-Compress/lib/IO/Compress/Zip.pm @@ -4,30 +4,30 @@ use strict ; use warnings; use bytes; -use IO::Compress::Base::Common 2.074 qw(:Status ); -use IO::Compress::RawDeflate 2.074 (); -use IO::Compress::Adapter::Deflate 2.074 ; -use IO::Compress::Adapter::Identity 2.074 ; -use IO::Compress::Zlib::Extra 2.074 ; -use IO::Compress::Zip::Constants 2.074 ; +use IO::Compress::Base::Common 2.081 qw(:Status ); +use IO::Compress::RawDeflate 2.081 (); +use IO::Compress::Adapter::Deflate 2.081 ; +use IO::Compress::Adapter::Identity 2.081 ; +use IO::Compress::Zlib::Extra 2.081 ; +use IO::Compress::Zip::Constants 2.081 ; use File::Spec(); use Config; -use Compress::Raw::Zlib 2.074 (); +use Compress::Raw::Zlib 2.081 (); BEGIN { eval { require IO::Compress::Adapter::Bzip2 ; - import IO::Compress::Adapter::Bzip2 2.074 ; + import IO::Compress::Adapter::Bzip2 2.081 ; require IO::Compress::Bzip2 ; - import IO::Compress::Bzip2 2.074 ; + import IO::Compress::Bzip2 2.081 ; } ; eval { require IO::Compress::Adapter::Lzma ; - import IO::Compress::Adapter::Lzma 2.074 ; + import IO::Compress::Adapter::Lzma 2.081 ; require IO::Compress::Lzma ; - import IO::Compress::Lzma 2.074 ; + import IO::Compress::Lzma 2.081 ; } ; } @@ -36,7 +36,7 @@ require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $ZipError); -$VERSION = '2.074'; +$VERSION = '2.081'; $ZipError = ''; @ISA = qw(IO::Compress::RawDeflate Exporter); @@ -863,14 +863,12 @@ __END__ =head1 NAME IO::Compress::Zip - Write zip files/buffers - - =head1 SYNOPSIS use IO::Compress::Zip qw(zip $ZipError) ; - my $status = zip $input => $output [,OPTS] + my $status = zip $input => $output [,OPTS] or die "zip failed: $ZipError\n"; my $z = new IO::Compress::Zip $output [,OPTS] @@ -890,9 +888,9 @@ IO::Compress::Zip - Write zip files/buffers $z->autoflush(); $z->input_line_number(); $z->newStream( [OPTS] ); - + $z->deflateParams(); - + $z->close() ; $ZipError ; @@ -907,11 +905,11 @@ IO::Compress::Zip - Write zip files/buffers binmode $z fileno $z close $z ; - + =head1 DESCRIPTION -This module provides a Perl interface that allows writing zip +This module provides a Perl interface that allows writing zip compressed data to files or buffer. The primary purpose of this module is to provide streaming write access to @@ -927,7 +925,7 @@ be installed. Note that to create LZMA content, the module C<IO::Compress::Lzma> must be installed. -For reading zip files/buffers, see the companion module +For reading zip files/buffers, see the companion module L<IO::Uncompress::Unzip|IO::Uncompress::Unzip>. =head1 Functional Interface @@ -939,7 +937,7 @@ section. use IO::Compress::Zip qw(zip $ZipError) ; - zip $input_filename_or_reference => $output_filename_or_reference [,OPTS] + zip $input_filename_or_reference => $output_filename_or_reference [,OPTS] or die "zip failed: $ZipError\n"; The functional interface needs Perl5.005 or better. @@ -952,7 +950,7 @@ C<$input_filename_or_reference> and C<$output_filename_or_reference>. =head3 The C<$input_filename_or_reference> parameter The parameter, C<$input_filename_or_reference>, is used to define the -source of the uncompressed data. +source of the uncompressed data. It can take one of the following forms: @@ -970,17 +968,17 @@ If the C<$input_filename_or_reference> parameter is a filehandle, the input data will be read from it. The string '-' can be used as an alias for standard input. -=item A scalar reference +=item A scalar reference If C<$input_filename_or_reference> is a scalar reference, the input data will be read from C<$$input_filename_or_reference>. -=item An array reference +=item An array reference If C<$input_filename_or_reference> is an array reference, each element in the array must be a filename. -The input data will be read from each file in turn. +The input data will be read from each file in turn. The complete array will be walked to ensure that it only contains valid filenames before any data is compressed. @@ -988,8 +986,8 @@ contains valid filenames before any data is compressed. =item An Input FileGlob string If C<$input_filename_or_reference> is a string that is delimited by the -characters "<" and ">" C<zip> will assume that it is an -I<input fileglob string>. The input is the list of files that match the +characters "<" and ">" C<zip> will assume that it is an +I<input fileglob string>. The input is the list of files that match the fileglob. See L<File::GlobMapper|File::GlobMapper> for more details. @@ -999,7 +997,7 @@ See L<File::GlobMapper|File::GlobMapper> for more details. If the C<$input_filename_or_reference> parameter is any other type, C<undef> will be returned. -In addition, if C<$input_filename_or_reference> is a simple filename, +In addition, if C<$input_filename_or_reference> is a simple filename, the default values for the C<Name>, C<Time>, C<TextFlag>, C<ExtAttr>, C<exUnixN> and C<exTime> options will be sourced from that file. @@ -1018,7 +1016,7 @@ these forms. =item A filename If the C<$output_filename_or_reference> parameter is a simple scalar, it is -assumed to be a filename. This file will be opened for writing and the +assumed to be a filename. This file will be opened for writing and the compressed data will be written to it. =item A filehandle @@ -1027,14 +1025,14 @@ If the C<$output_filename_or_reference> parameter is a filehandle, the compressed data will be written to it. The string '-' can be used as an alias for standard output. -=item A scalar reference +=item A scalar reference If C<$output_filename_or_reference> is a scalar reference, the compressed data will be stored in C<$$output_filename_or_reference>. =item An Array Reference -If C<$output_filename_or_reference> is an array reference, +If C<$output_filename_or_reference> is an array reference, the compressed data will be pushed onto the array. =item An Output FileGlob @@ -1072,7 +1070,7 @@ L</"Constructor Options"> section below. =item C<< AutoClose => 0|1 >> -This option applies to any input or output data streams to +This option applies to any input or output data streams to C<zip> that are filehandles. If C<AutoClose> is specified, and the value is true, it will result in all @@ -1114,7 +1112,7 @@ written to it. Otherwise the file pointer will not be moved. =back -When C<Append> is specified, and set to true, it will I<append> all compressed +When C<Append> is specified, and set to true, it will I<append> all compressed data to the output data stream. So when the output is a filehandle it will carry out a seek to the eof @@ -1158,7 +1156,7 @@ compressed data to a buffer, C<$buffer>. my $input = new IO::File "<file1.txt" or die "Cannot open 'file1.txt': $!\n" ; my $buffer ; - zip $input => \$buffer + zip $input => \$buffer or die "zip failed: $ZipError\n"; To create a zip file, C<output.zip>, that contains the compressed contents @@ -1197,14 +1195,14 @@ The format of the constructor for C<IO::Compress::Zip> is shown below my $z = new IO::Compress::Zip $output [,OPTS] or die "IO::Compress::Zip failed: $ZipError\n"; -It returns an C<IO::Compress::Zip> object on success and undef on failure. +It returns an C<IO::Compress::Zip> object on success and undef on failure. The variable C<$ZipError> will contain an error message on failure. -If you are running Perl 5.005 or better the object, C<$z>, returned from -IO::Compress::Zip can be used exactly like an L<IO::File|IO::File> filehandle. -This means that all normal output file operations can be carried out -with C<$z>. -For example, to write to a compressed file/buffer you can use either of +If you are running Perl 5.005 or better the object, C<$z>, returned from +IO::Compress::Zip can be used exactly like an L<IO::File|IO::File> filehandle. +This means that all normal output file operations can be carried out +with C<$z>. +For example, to write to a compressed file/buffer you can use either of these forms $z->print("hello world\n"); @@ -1227,7 +1225,7 @@ If the C<$output> parameter is a filehandle, the compressed data will be written to it. The string '-' can be used as an alias for standard output. -=item A scalar reference +=item A scalar reference If C<$output> is a scalar reference, the compressed data will be stored in C<$$output>. @@ -1254,7 +1252,7 @@ This parameter defaults to 0. =item C<< Append => 0|1 >> -Opens C<$output> in append mode. +Opens C<$output> in append mode. The behaviour of this option is dependent on the type of C<$output>. @@ -1284,7 +1282,7 @@ This parameter defaults to 0. =item C<< Name => $string >> -Stores the contents of C<$string> in the zip filename header field. +Stores the contents of C<$string> in the zip filename header field. If C<Name> is not specified and the C<$input> parameter is a filename, the value of C<$input> will be used for the zip filename header field. @@ -1306,7 +1304,7 @@ to create a non-standard Zip file. This is what APPNOTE.TXT has to say on what should be stored in the zip filename header field. - The name of the file, with optional relative path. + The name of the file, with optional relative path. The path stored should not contain a drive or device letter, or a leading slash. All slashes should be forward slashes '/' as opposed to @@ -1344,8 +1342,8 @@ filenames before they are stored in C<$zipfile>. my $dir = shift ; zip [ <$dir/*.txt> ] => $zipfile, - FilterName => sub { s[^$dir/][] } ; - } + FilterName => sub { s[^$dir/][] } ; + } =item C<< Time => $number >> @@ -1360,7 +1358,7 @@ filename. This option controls the "external file attributes" field in the central header of the zip file. This is a 4 byte field. -If you are running a Unix derivative this value defaults to +If you are running a Unix derivative this value defaults to 0100644 << 16 @@ -1398,7 +1396,7 @@ and C<$gid>. These values correspond to the numeric User ID (UID) and Group ID When the C<exUnix2> option is present it will trigger the creation of a Unix2 extra field (ID is "Ux") in the local zip header. This will be populated with C<$uid> and C<$gid>. An empty Unix2 extra field will also -be created in the central zip header. +be created in the central zip header. Note - The UID & GID are stored as 16-bit integers in the "Ux" field. Use C<< exUnixN >> if your UID or GID are @@ -1415,8 +1413,8 @@ and C<$gid>. These values correspond to the numeric User ID (UID) and Group ID (GID) of the owner of the files respectively. When the C<exUnixN> option is present it will trigger the creation of a -UnixN extra field (ID is "ux") in both the local and central zip headers. -This will be populated with C<$uid> and C<$gid>. +UnixN extra field (ID is "ux") in both the local and central zip headers. +This will be populated with C<$uid> and C<$gid>. The UID & GID are stored as 32-bit integers. If the C<Minimal> option is set to true, this option will be ignored. @@ -1440,10 +1438,10 @@ By default, no comment field is written to the zip file. =item C<< Method => $method >> Controls which compression method is used. At present four compression -methods are supported, namely Store (no compression at all), Deflate, +methods are supported, namely Store (no compression at all), Deflate, Bzip2 and Lzma. -The symbols, ZIP_CM_STORE, ZIP_CM_DEFLATE, ZIP_CM_BZIP2 and ZIP_CM_LZMA +The symbols, ZIP_CM_STORE, ZIP_CM_DEFLATE, ZIP_CM_BZIP2 and ZIP_CM_LZMA are used to select the compression method. These constants are not imported by C<IO::Compress::Zip> by default. @@ -1476,17 +1474,17 @@ The default is 1. Create a Zip64 zip file/buffer. This option is used if you want to store files larger than 4 Gig or store more than 64K files in a single -zip archive.. +zip archive. -C<Zip64> will be automatically set, as needed, if working with the one-shot +C<Zip64> will be automatically set, as needed, if working with the one-shot interface when the input is either a filename or a scalar reference. If you intend to manipulate the Zip64 zip files created with this module -using an external zip/unzip, make sure that it supports Zip64. +using an external zip/unzip, make sure that it supports Zip64. In particular, if you are using Info-Zip you need to have zip version 3.x or better to update a Zip64 archive and unzip version 6.x to read a zip64 -archive. +archive. The default is 0. @@ -1499,7 +1497,7 @@ text. In one-shot mode this flag will be set to true if the Perl C<-T> operator thinks the file contains text. -The default is 0. +The default is 0. =item C<< ExtraFieldLocal => $data >> @@ -1529,7 +1527,7 @@ The list of subfields can be supplied in any of the following formats ... } -Where C<$id1>, C<$id2> are two byte subfield ID's. +Where C<$id1>, C<$id2> are two byte subfield ID's. If you use the hash syntax, you have no control over the order in which the ExtraSubFields are stored, plus you cannot have SubFields with @@ -1539,8 +1537,8 @@ Alternatively the list of subfields can by supplied as a scalar, thus ExtraField => $rawdata -In this case C<IO::Compress::Zip> will check that C<$rawdata> consists of -zero or more conformant sub-fields. +In this case C<IO::Compress::Zip> will check that C<$rawdata> consists of +zero or more conformant sub-fields. The Extended Time field (ID "UT"), set using the C<exTime> option, and the Unix2 extra field (ID "Ux), set using the C<exUnix2> option, are examples @@ -1554,14 +1552,14 @@ The maximum size of an extra field 65535 bytes. If specified, this option will disable the creation of all extra fields in the zip local and central headers. So the C<exTime>, C<exUnix2>, -C<exUnixN>, C<ExtraFieldLocal> and C<ExtraFieldCentral> options will +C<exUnixN>, C<ExtraFieldLocal> and C<ExtraFieldCentral> options will be ignored. This parameter defaults to 0. =item C<< BlockSize100K => number >> -Specify the number of 100K blocks bzip2 uses during compression. +Specify the number of 100K blocks bzip2 uses during compression. Valid values are from 1 to 9, where 9 is best compression. @@ -1608,7 +1606,7 @@ otherwise. Defaults to 0. -=item -Level +=item -Level Defines the compression level used by zlib. The value should either be a number between 0 and 9 (0 means no compression and 9 is maximum @@ -1627,7 +1625,7 @@ Note, these constants are not imported by C<IO::Compress::Zip> by default. use IO::Compress::Zip qw(:constants); use IO::Compress::Zip qw(:all); -=item -Strategy +=item -Strategy Defines the strategy used to tune the compression. Use one of the symbolic constants defined below. @@ -1650,7 +1648,7 @@ This is a placeholder option. TODO -=head1 Methods +=head1 Methods =head2 print @@ -1768,7 +1766,7 @@ This is a noop provided for completeness. $z->opened() -Returns true if the object currently refers to a opened file/buffer. +Returns true if the object currently refers to a opened file/buffer. =head2 autoflush @@ -1791,7 +1789,7 @@ retrieve the autoflush setting. $z->input_line_number() $z->input_line_number(EXPR) -This method always returns C<undef> when compressing. +This method always returns C<undef> when compressing. =head2 fileno @@ -1810,7 +1808,7 @@ C<undef>. $z->close() ; close $z ; -Flushes any pending compressed data and then closes the output file/buffer. +Flushes any pending compressed data and then closes the output file/buffer. For most versions of Perl this method will be automatically invoked if the IO::Compress::Zip object is destroyed (either explicitly or by the @@ -1851,9 +1849,9 @@ Usage is TODO -=head1 Importing +=head1 Importing -A number of symbolic constants are required by some methods in +A number of symbolic constants are required by some methods in C<IO::Compress::Zip>. None are imported by default. =over 5 @@ -1910,9 +1908,6 @@ constructor. ZIP_CM_DEFLATE ZIP_CM_BZIP2 - - - =back =head1 EXAMPLES @@ -1935,7 +1930,7 @@ L<File::GlobMapper|File::GlobMapper>, L<Archive::Zip|Archive::Zip>, L<Archive::Tar|Archive::Tar>, L<IO::Zlib|IO::Zlib> -For RFC 1950, 1951 and 1952 see +For RFC 1950, 1951 and 1952 see L<http://www.faqs.org/rfcs/rfc1950.html>, L<http://www.faqs.org/rfcs/rfc1951.html> and L<http://www.faqs.org/rfcs/rfc1952.html> @@ -1950,7 +1945,7 @@ The primary site for gzip is L<http://www.gzip.org>. =head1 AUTHOR -This module was written by Paul Marquess, C<pmqs@cpan.org>. +This module was written by Paul Marquess, C<pmqs@cpan.org>. =head1 MODIFICATION HISTORY @@ -1958,7 +1953,7 @@ See the Changes file. =head1 COPYRIGHT AND LICENSE -Copyright (c) 2005-2017 Paul Marquess. All rights reserved. +Copyright (c) 2005-2018 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/IO/Compress/Zip/Constants.pm b/cpan/IO-Compress/lib/IO/Compress/Zip/Constants.pm index 7e38f1b9aa..5cb7fc27a1 100644 --- a/cpan/IO-Compress/lib/IO/Compress/Zip/Constants.pm +++ b/cpan/IO-Compress/lib/IO/Compress/Zip/Constants.pm @@ -7,7 +7,7 @@ require Exporter; our ($VERSION, @ISA, @EXPORT, %ZIP_CM_MIN_VERSIONS); -$VERSION = '2.074'; +$VERSION = '2.081'; @ISA = qw(Exporter); diff --git a/cpan/IO-Compress/lib/IO/Compress/Zlib/Constants.pm b/cpan/IO-Compress/lib/IO/Compress/Zlib/Constants.pm index 02d8d36517..eb2aec51dc 100644 --- a/cpan/IO-Compress/lib/IO/Compress/Zlib/Constants.pm +++ b/cpan/IO-Compress/lib/IO/Compress/Zlib/Constants.pm @@ -9,7 +9,7 @@ require Exporter; our ($VERSION, @ISA, @EXPORT); -$VERSION = '2.074'; +$VERSION = '2.081'; @ISA = qw(Exporter); diff --git a/cpan/IO-Compress/lib/IO/Compress/Zlib/Extra.pm b/cpan/IO-Compress/lib/IO/Compress/Zlib/Extra.pm index f710309e7b..6b60c49f91 100644 --- a/cpan/IO-Compress/lib/IO/Compress/Zlib/Extra.pm +++ b/cpan/IO-Compress/lib/IO/Compress/Zlib/Extra.pm @@ -8,9 +8,9 @@ use bytes; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS); -$VERSION = '2.074'; +$VERSION = '2.081'; -use IO::Compress::Gzip::Constants 2.074 ; +use IO::Compress::Gzip::Constants 2.081 ; sub ExtraFieldError { diff --git a/cpan/IO-Compress/lib/IO/Uncompress/Adapter/Bunzip2.pm b/cpan/IO-Compress/lib/IO/Uncompress/Adapter/Bunzip2.pm index 2bd5e24236..f0f24f15f9 100644 --- a/cpan/IO-Compress/lib/IO/Uncompress/Adapter/Bunzip2.pm +++ b/cpan/IO-Compress/lib/IO/Uncompress/Adapter/Bunzip2.pm @@ -4,12 +4,12 @@ use strict; use warnings; use bytes; -use IO::Compress::Base::Common 2.074 qw(:Status); +use IO::Compress::Base::Common 2.081 qw(:Status); -use Compress::Raw::Bzip2 2.074 ; +use Compress::Raw::Bzip2 2.081 ; our ($VERSION, @ISA); -$VERSION = '2.074'; +$VERSION = '2.081'; sub mkUncompObject { diff --git a/cpan/IO-Compress/lib/IO/Uncompress/Adapter/Identity.pm b/cpan/IO-Compress/lib/IO/Uncompress/Adapter/Identity.pm index 3327fbc4bc..a122320de2 100644 --- a/cpan/IO-Compress/lib/IO/Uncompress/Adapter/Identity.pm +++ b/cpan/IO-Compress/lib/IO/Uncompress/Adapter/Identity.pm @@ -4,14 +4,14 @@ use warnings; use strict; use bytes; -use IO::Compress::Base::Common 2.074 qw(:Status); +use IO::Compress::Base::Common 2.081 qw(:Status); use IO::Compress::Zip::Constants ; our ($VERSION); -$VERSION = '2.074'; +$VERSION = '2.081'; -use Compress::Raw::Zlib 2.074 (); +use Compress::Raw::Zlib 2.081 (); sub mkUncompObject { diff --git a/cpan/IO-Compress/lib/IO/Uncompress/Adapter/Inflate.pm b/cpan/IO-Compress/lib/IO/Uncompress/Adapter/Inflate.pm index 256d8409dd..d5544faee8 100644 --- a/cpan/IO-Compress/lib/IO/Uncompress/Adapter/Inflate.pm +++ b/cpan/IO-Compress/lib/IO/Uncompress/Adapter/Inflate.pm @@ -4,11 +4,11 @@ use strict; use warnings; use bytes; -use IO::Compress::Base::Common 2.074 qw(:Status); -use Compress::Raw::Zlib 2.074 qw(Z_OK Z_BUF_ERROR Z_STREAM_END Z_FINISH MAX_WBITS); +use IO::Compress::Base::Common 2.081 qw(:Status); +use Compress::Raw::Zlib 2.081 qw(Z_OK Z_BUF_ERROR Z_STREAM_END Z_FINISH MAX_WBITS); our ($VERSION); -$VERSION = '2.074'; +$VERSION = '2.081'; diff --git a/cpan/IO-Compress/lib/IO/Uncompress/AnyInflate.pm b/cpan/IO-Compress/lib/IO/Uncompress/AnyInflate.pm index 40264960fd..563f2f679e 100644 --- a/cpan/IO-Compress/lib/IO/Uncompress/AnyInflate.pm +++ b/cpan/IO-Compress/lib/IO/Uncompress/AnyInflate.pm @@ -6,22 +6,22 @@ use strict; use warnings; use bytes; -use IO::Compress::Base::Common 2.074 (); +use IO::Compress::Base::Common 2.081 (); -use IO::Uncompress::Adapter::Inflate 2.074 (); +use IO::Uncompress::Adapter::Inflate 2.081 (); -use IO::Uncompress::Base 2.074 ; -use IO::Uncompress::Gunzip 2.074 ; -use IO::Uncompress::Inflate 2.074 ; -use IO::Uncompress::RawInflate 2.074 ; -use IO::Uncompress::Unzip 2.074 ; +use IO::Uncompress::Base 2.081 ; +use IO::Uncompress::Gunzip 2.081 ; +use IO::Uncompress::Inflate 2.081 ; +use IO::Uncompress::RawInflate 2.081 ; +use IO::Uncompress::Unzip 2.081 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $AnyInflateError); -$VERSION = '2.074'; +$VERSION = '2.081'; $AnyInflateError = ''; @ISA = qw(IO::Uncompress::Base Exporter); @@ -48,7 +48,7 @@ sub anyinflate sub getExtraParams { - use IO::Compress::Base::Common 2.074 qw(:Parse); + use IO::Compress::Base::Common 2.081 qw(:Parse); return ( 'rawinflate' => [Parse_boolean, 0] ) ; } @@ -135,7 +135,7 @@ IO::Uncompress::AnyInflate - Uncompress zlib-based (zip, gzip) file/buffer my $status = anyinflate $input => $output [,OPTS] or die "anyinflate failed: $AnyInflateError\n"; - my $z = new IO::Uncompress::AnyInflate $input [OPTS] + my $z = new IO::Uncompress::AnyInflate $input [OPTS] or die "anyinflate failed: $AnyInflateError\n"; $status = $z->read($buffer) @@ -205,7 +205,7 @@ section. use IO::Uncompress::AnyInflate qw(anyinflate $AnyInflateError) ; - anyinflate $input_filename_or_reference => $output_filename_or_reference [,OPTS] + anyinflate $input_filename_or_reference => $output_filename_or_reference [,OPTS] or die "anyinflate failed: $AnyInflateError\n"; The functional interface needs Perl5.005 or better. @@ -218,7 +218,7 @@ C<$input_filename_or_reference> and C<$output_filename_or_reference>. =head3 The C<$input_filename_or_reference> parameter The parameter, C<$input_filename_or_reference>, is used to define the -source of the compressed data. +source of the compressed data. It can take one of the following forms: @@ -236,17 +236,17 @@ If the C<$input_filename_or_reference> parameter is a filehandle, the input data will be read from it. The string '-' can be used as an alias for standard input. -=item A scalar reference +=item A scalar reference If C<$input_filename_or_reference> is a scalar reference, the input data will be read from C<$$input_filename_or_reference>. -=item An array reference +=item An array reference If C<$input_filename_or_reference> is an array reference, each element in the array must be a filename. -The input data will be read from each file in turn. +The input data will be read from each file in turn. The complete array will be walked to ensure that it only contains valid filenames before any data is uncompressed. @@ -254,8 +254,8 @@ contains valid filenames before any data is uncompressed. =item An Input FileGlob string If C<$input_filename_or_reference> is a string that is delimited by the -characters "<" and ">" C<anyinflate> will assume that it is an -I<input fileglob string>. The input is the list of files that match the +characters "<" and ">" C<anyinflate> will assume that it is an +I<input fileglob string>. The input is the list of files that match the fileglob. See L<File::GlobMapper|File::GlobMapper> for more details. @@ -276,7 +276,7 @@ these forms. =item A filename If the C<$output_filename_or_reference> parameter is a simple scalar, it is -assumed to be a filename. This file will be opened for writing and the +assumed to be a filename. This file will be opened for writing and the uncompressed data will be written to it. =item A filehandle @@ -285,14 +285,14 @@ If the C<$output_filename_or_reference> parameter is a filehandle, the uncompressed data will be written to it. The string '-' can be used as an alias for standard output. -=item A scalar reference +=item A scalar reference If C<$output_filename_or_reference> is a scalar reference, the uncompressed data will be stored in C<$$output_filename_or_reference>. =item An Array Reference -If C<$output_filename_or_reference> is an array reference, +If C<$output_filename_or_reference> is an array reference, the uncompressed data will be pushed onto the array. =item An Output FileGlob @@ -331,7 +331,7 @@ L</"Constructor Options"> section below. =item C<< AutoClose => 0|1 >> -This option applies to any input or output data streams to +This option applies to any input or output data streams to C<anyinflate> that are filehandles. If C<AutoClose> is specified, and the value is true, it will result in all @@ -374,7 +374,7 @@ written to it. Otherwise the file pointer will not be moved. =back -When C<Append> is specified, and set to true, it will I<append> all uncompressed +When C<Append> is specified, and set to true, it will I<append> all uncompressed data to the output data stream. So when the output is a filehandle it will carry out a seek to the eof @@ -402,7 +402,7 @@ Defaults to 0. =item C<< TrailingData => $scalar >> Returns the data, if any, that is present immediately after the compressed -data stream once uncompression is complete. +data stream once uncompression is complete. This option can be used when there is useful information immediately following the compressed data stream, and you don't know the length of the @@ -414,7 +414,7 @@ end of the compressed data stream to the end of the buffer. If the input is a filehandle, C<trailingData> will return the data that is left in the filehandle input buffer once the end of the compressed data stream has been reached. You can then use the filehandle to read the rest -of the input file. +of the input file. Don't bother using C<trailingData> if the input is a filename. @@ -449,7 +449,7 @@ uncompressed data to a buffer, C<$buffer>. my $input = new IO::File "<file1.txt.Compressed" or die "Cannot open 'file1.txt.Compressed': $!\n" ; my $buffer ; - anyinflate $input => \$buffer + anyinflate $input => \$buffer or die "anyinflate failed: $AnyInflateError\n"; To uncompress all files in the directory "/my/home" that match "*.txt.Compressed" and store the compressed data in the same directory @@ -471,7 +471,7 @@ and if you want to compress each file one at a time, this will do the trick { my $output = $input; $output =~ s/.Compressed// ; - anyinflate $input => $output + anyinflate $input => $output or die "Error compressing '$input': $AnyInflateError\n"; } @@ -512,7 +512,7 @@ If the C<$input> parameter is a filehandle, the compressed data will be read from it. The string '-' can be used as an alias for standard input. -=item A scalar reference +=item A scalar reference If C<$input> is a scalar reference, the compressed data will be read from C<$$input>. @@ -587,7 +587,7 @@ When present this option will limit the number of compressed bytes read from the input file/buffer to C<$size>. This option can be used in the situation where there is useful data directly after the compressed data stream and you know beforehand the exact length of the compressed data -stream. +stream. This option is mostly used when reading from a filehandle, in which case the file pointer will be left pointing to the first byte directly after the @@ -634,7 +634,7 @@ If the input is a gzip (RFC 1952) data stream, the following will be checked: =over 5 -=item 1 +=item 1 If the FHCRC bit is set in the gzip FLG header byte, the CRC16 bytes in the header must match the crc16 value of the gzip header actually read. @@ -673,7 +673,7 @@ uncompressed data actually read from the file. =item C<< RawInflate => 0|1 >> When auto-detecting the compressed format, try to test for raw-deflate (RFC -1951) content using the C<IO::Uncompress::RawInflate> module. +1951) content using the C<IO::Uncompress::RawInflate> module. The reason this is not default behaviour is because RFC 1951 content can only be detected by attempting to uncompress it. This process is error @@ -696,7 +696,7 @@ Defaults to 0. TODO -=head1 Methods +=head1 Methods =head2 read @@ -740,16 +740,16 @@ Usage is $line = $z->getline() $line = <$z> -Reads a single line. +Reads a single line. This method fully supports the use of the variable C<$/> (or C<$INPUT_RECORD_SEPARATOR> or C<$RS> when C<English> is in use) to determine what constitutes an end of line. Paragraph mode, record mode and -file slurp mode are all supported. +file slurp mode are all supported. =head2 getc -Usage is +Usage is $char = $z->getc() @@ -832,7 +832,7 @@ This is a noop provided for completeness. $z->opened() -Returns true if the object currently refers to a opened file/buffer. +Returns true if the object currently refers to a opened file/buffer. =head2 autoflush @@ -879,7 +879,7 @@ C<undef>. $z->close() ; close $z ; -Closes the output file/buffer. +Closes the output file/buffer. For most versions of Perl this method will be automatically invoked if the IO::Uncompress::AnyInflate object is destroyed (either explicitly or by the @@ -933,7 +933,7 @@ end of the compressed data stream to the end of the buffer. If the input is a filehandle, C<trailingData> will return the data that is left in the filehandle input buffer once the end of the compressed data stream has been reached. You can then use the filehandle to read the rest -of the input file. +of the input file. Don't bother using C<trailingData> if the input is a filename. @@ -941,9 +941,9 @@ If you know the length of the compressed data stream before you start uncompressing, you can avoid having to use C<trailingData> by setting the C<InputLength> option in the constructor. -=head1 Importing +=head1 Importing -No symbolic constants are required by this IO::Uncompress::AnyInflate at present. +No symbolic constants are required by this IO::Uncompress::AnyInflate at present. =over 5 @@ -972,7 +972,7 @@ L<File::GlobMapper|File::GlobMapper>, L<Archive::Zip|Archive::Zip>, L<Archive::Tar|Archive::Tar>, L<IO::Zlib|IO::Zlib> -For RFC 1950, 1951 and 1952 see +For RFC 1950, 1951 and 1952 see L<http://www.faqs.org/rfcs/rfc1950.html>, L<http://www.faqs.org/rfcs/rfc1951.html> and L<http://www.faqs.org/rfcs/rfc1952.html> @@ -987,7 +987,7 @@ The primary site for gzip is L<http://www.gzip.org>. =head1 AUTHOR -This module was written by Paul Marquess, C<pmqs@cpan.org>. +This module was written by Paul Marquess, C<pmqs@cpan.org>. =head1 MODIFICATION HISTORY @@ -995,7 +995,7 @@ See the Changes file. =head1 COPYRIGHT AND LICENSE -Copyright (c) 2005-2017 Paul Marquess. All rights reserved. +Copyright (c) 2005-2018 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/IO/Uncompress/AnyUncompress.pm b/cpan/IO-Compress/lib/IO/Uncompress/AnyUncompress.pm index e149a129ac..c2d7687570 100644 --- a/cpan/IO-Compress/lib/IO/Uncompress/AnyUncompress.pm +++ b/cpan/IO-Compress/lib/IO/Uncompress/AnyUncompress.pm @@ -4,16 +4,16 @@ use strict; use warnings; use bytes; -use IO::Compress::Base::Common 2.074 (); +use IO::Compress::Base::Common 2.081 (); -use IO::Uncompress::Base 2.074 ; +use IO::Uncompress::Base 2.081 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $AnyUncompressError); -$VERSION = '2.074'; +$VERSION = '2.081'; $AnyUncompressError = ''; @ISA = qw(IO::Uncompress::Base Exporter); @@ -29,22 +29,22 @@ BEGIN { local @INC = @INC; pop @INC if $INC[-1] eq '.'; - eval ' use IO::Uncompress::Adapter::Inflate 2.074 ;'; - eval ' use IO::Uncompress::Adapter::Bunzip2 2.074 ;'; - eval ' use IO::Uncompress::Adapter::LZO 2.074 ;'; - eval ' use IO::Uncompress::Adapter::Lzf 2.074 ;'; - eval ' use IO::Uncompress::Adapter::UnLzma 2.074 ;'; - eval ' use IO::Uncompress::Adapter::UnXz 2.074 ;'; - - eval ' use IO::Uncompress::Bunzip2 2.074 ;'; - eval ' use IO::Uncompress::UnLzop 2.074 ;'; - eval ' use IO::Uncompress::Gunzip 2.074 ;'; - eval ' use IO::Uncompress::Inflate 2.074 ;'; - eval ' use IO::Uncompress::RawInflate 2.074 ;'; - eval ' use IO::Uncompress::Unzip 2.074 ;'; - eval ' use IO::Uncompress::UnLzf 2.074 ;'; - eval ' use IO::Uncompress::UnLzma 2.074 ;'; - eval ' use IO::Uncompress::UnXz 2.074 ;'; + eval ' use IO::Uncompress::Adapter::Inflate 2.081 ;'; + eval ' use IO::Uncompress::Adapter::Bunzip2 2.081 ;'; + eval ' use IO::Uncompress::Adapter::LZO 2.081 ;'; + eval ' use IO::Uncompress::Adapter::Lzf 2.081 ;'; + eval ' use IO::Uncompress::Adapter::UnLzma 2.081 ;'; + eval ' use IO::Uncompress::Adapter::UnXz 2.081 ;'; + + eval ' use IO::Uncompress::Bunzip2 2.081 ;'; + eval ' use IO::Uncompress::UnLzop 2.081 ;'; + eval ' use IO::Uncompress::Gunzip 2.081 ;'; + eval ' use IO::Uncompress::Inflate 2.081 ;'; + eval ' use IO::Uncompress::RawInflate 2.081 ;'; + eval ' use IO::Uncompress::Unzip 2.081 ;'; + eval ' use IO::Uncompress::UnLzf 2.081 ;'; + eval ' use IO::Uncompress::UnLzma 2.081 ;'; + eval ' use IO::Uncompress::UnXz 2.081 ;'; } sub new @@ -237,7 +237,7 @@ IO::Uncompress::AnyUncompress - Uncompress gzip, zip, bzip2 or lzop file/buffer my $status = anyuncompress $input => $output [,OPTS] or die "anyuncompress failed: $AnyUncompressError\n"; - my $z = new IO::Uncompress::AnyUncompress $input [OPTS] + my $z = new IO::Uncompress::AnyUncompress $input [OPTS] or die "anyuncompress failed: $AnyUncompressError\n"; $status = $z->read($buffer) @@ -315,7 +315,7 @@ section. use IO::Uncompress::AnyUncompress qw(anyuncompress $AnyUncompressError) ; - anyuncompress $input_filename_or_reference => $output_filename_or_reference [,OPTS] + anyuncompress $input_filename_or_reference => $output_filename_or_reference [,OPTS] or die "anyuncompress failed: $AnyUncompressError\n"; The functional interface needs Perl5.005 or better. @@ -328,7 +328,7 @@ C<$input_filename_or_reference> and C<$output_filename_or_reference>. =head3 The C<$input_filename_or_reference> parameter The parameter, C<$input_filename_or_reference>, is used to define the -source of the compressed data. +source of the compressed data. It can take one of the following forms: @@ -346,17 +346,17 @@ If the C<$input_filename_or_reference> parameter is a filehandle, the input data will be read from it. The string '-' can be used as an alias for standard input. -=item A scalar reference +=item A scalar reference If C<$input_filename_or_reference> is a scalar reference, the input data will be read from C<$$input_filename_or_reference>. -=item An array reference +=item An array reference If C<$input_filename_or_reference> is an array reference, each element in the array must be a filename. -The input data will be read from each file in turn. +The input data will be read from each file in turn. The complete array will be walked to ensure that it only contains valid filenames before any data is uncompressed. @@ -364,8 +364,8 @@ contains valid filenames before any data is uncompressed. =item An Input FileGlob string If C<$input_filename_or_reference> is a string that is delimited by the -characters "<" and ">" C<anyuncompress> will assume that it is an -I<input fileglob string>. The input is the list of files that match the +characters "<" and ">" C<anyuncompress> will assume that it is an +I<input fileglob string>. The input is the list of files that match the fileglob. See L<File::GlobMapper|File::GlobMapper> for more details. @@ -386,7 +386,7 @@ these forms. =item A filename If the C<$output_filename_or_reference> parameter is a simple scalar, it is -assumed to be a filename. This file will be opened for writing and the +assumed to be a filename. This file will be opened for writing and the uncompressed data will be written to it. =item A filehandle @@ -395,14 +395,14 @@ If the C<$output_filename_or_reference> parameter is a filehandle, the uncompressed data will be written to it. The string '-' can be used as an alias for standard output. -=item A scalar reference +=item A scalar reference If C<$output_filename_or_reference> is a scalar reference, the uncompressed data will be stored in C<$$output_filename_or_reference>. =item An Array Reference -If C<$output_filename_or_reference> is an array reference, +If C<$output_filename_or_reference> is an array reference, the uncompressed data will be pushed onto the array. =item An Output FileGlob @@ -441,7 +441,7 @@ L</"Constructor Options"> section below. =item C<< AutoClose => 0|1 >> -This option applies to any input or output data streams to +This option applies to any input or output data streams to C<anyuncompress> that are filehandles. If C<AutoClose> is specified, and the value is true, it will result in all @@ -484,7 +484,7 @@ written to it. Otherwise the file pointer will not be moved. =back -When C<Append> is specified, and set to true, it will I<append> all uncompressed +When C<Append> is specified, and set to true, it will I<append> all uncompressed data to the output data stream. So when the output is a filehandle it will carry out a seek to the eof @@ -512,7 +512,7 @@ Defaults to 0. =item C<< TrailingData => $scalar >> Returns the data, if any, that is present immediately after the compressed -data stream once uncompression is complete. +data stream once uncompression is complete. This option can be used when there is useful information immediately following the compressed data stream, and you don't know the length of the @@ -524,7 +524,7 @@ end of the compressed data stream to the end of the buffer. If the input is a filehandle, C<trailingData> will return the data that is left in the filehandle input buffer once the end of the compressed data stream has been reached. You can then use the filehandle to read the rest -of the input file. +of the input file. Don't bother using C<trailingData> if the input is a filename. @@ -559,7 +559,7 @@ uncompressed data to a buffer, C<$buffer>. my $input = new IO::File "<file1.txt.Compressed" or die "Cannot open 'file1.txt.Compressed': $!\n" ; my $buffer ; - anyuncompress $input => \$buffer + anyuncompress $input => \$buffer or die "anyuncompress failed: $AnyUncompressError\n"; To uncompress all files in the directory "/my/home" that match "*.txt.Compressed" and store the compressed data in the same directory @@ -581,7 +581,7 @@ and if you want to compress each file one at a time, this will do the trick { my $output = $input; $output =~ s/.Compressed// ; - anyuncompress $input => $output + anyuncompress $input => $output or die "Error compressing '$input': $AnyUncompressError\n"; } @@ -622,7 +622,7 @@ If the C<$input> parameter is a filehandle, the compressed data will be read from it. The string '-' can be used as an alias for standard input. -=item A scalar reference +=item A scalar reference If C<$input> is a scalar reference, the compressed data will be read from C<$$input>. @@ -697,7 +697,7 @@ When present this option will limit the number of compressed bytes read from the input file/buffer to C<$size>. This option can be used in the situation where there is useful data directly after the compressed data stream and you know beforehand the exact length of the compressed data -stream. +stream. This option is mostly used when reading from a filehandle, in which case the file pointer will be left pointing to the first byte directly after the @@ -728,7 +728,7 @@ The default for this option is off. =item C<< RawInflate => 0|1 >> When auto-detecting the compressed format, try to test for raw-deflate (RFC -1951) content using the C<IO::Uncompress::RawInflate> module. +1951) content using the C<IO::Uncompress::RawInflate> module. The reason this is not default behaviour is because RFC 1951 content can only be detected by attempting to uncompress it. This process is error @@ -739,7 +739,7 @@ Defaults to 0. =item C<< UnLzma => 0|1 >> When auto-detecting the compressed format, try to test for lzma_alone -content using the C<IO::Uncompress::UnLzma> module. +content using the C<IO::Uncompress::UnLzma> module. The reason this is not default behaviour is because lzma_alone content can only be detected by attempting to uncompress it. This process is error @@ -753,7 +753,7 @@ Defaults to 0. TODO -=head1 Methods +=head1 Methods =head2 read @@ -797,16 +797,16 @@ Usage is $line = $z->getline() $line = <$z> -Reads a single line. +Reads a single line. This method fully supports the use of the variable C<$/> (or C<$INPUT_RECORD_SEPARATOR> or C<$RS> when C<English> is in use) to determine what constitutes an end of line. Paragraph mode, record mode and -file slurp mode are all supported. +file slurp mode are all supported. =head2 getc -Usage is +Usage is $char = $z->getc() @@ -881,7 +881,7 @@ This is a noop provided for completeness. $z->opened() -Returns true if the object currently refers to a opened file/buffer. +Returns true if the object currently refers to a opened file/buffer. =head2 autoflush @@ -928,7 +928,7 @@ C<undef>. $z->close() ; close $z ; -Closes the output file/buffer. +Closes the output file/buffer. For most versions of Perl this method will be automatically invoked if the IO::Uncompress::AnyUncompress object is destroyed (either explicitly or by the @@ -982,7 +982,7 @@ end of the compressed data stream to the end of the buffer. If the input is a filehandle, C<trailingData> will return the data that is left in the filehandle input buffer once the end of the compressed data stream has been reached. You can then use the filehandle to read the rest -of the input file. +of the input file. Don't bother using C<trailingData> if the input is a filename. @@ -990,9 +990,9 @@ If you know the length of the compressed data stream before you start uncompressing, you can avoid having to use C<trailingData> by setting the C<InputLength> option in the constructor. -=head1 Importing +=head1 Importing -No symbolic constants are required by this IO::Uncompress::AnyUncompress at present. +No symbolic constants are required by this IO::Uncompress::AnyUncompress at present. =over 5 @@ -1019,7 +1019,7 @@ L<IO::Zlib|IO::Zlib> =head1 AUTHOR -This module was written by Paul Marquess, C<pmqs@cpan.org>. +This module was written by Paul Marquess, C<pmqs@cpan.org>. =head1 MODIFICATION HISTORY @@ -1027,7 +1027,7 @@ See the Changes file. =head1 COPYRIGHT AND LICENSE -Copyright (c) 2005-2017 Paul Marquess. All rights reserved. +Copyright (c) 2005-2018 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/IO/Uncompress/Base.pm b/cpan/IO-Compress/lib/IO/Uncompress/Base.pm index 4ba3efab16..ff9b1ae630 100644 --- a/cpan/IO-Compress/lib/IO/Uncompress/Base.pm +++ b/cpan/IO-Compress/lib/IO/Uncompress/Base.pm @@ -9,12 +9,12 @@ our (@ISA, $VERSION, @EXPORT_OK, %EXPORT_TAGS); @ISA = qw(IO::File Exporter); -$VERSION = '2.074'; +$VERSION = '2.081'; use constant G_EOF => 0 ; use constant G_ERR => -1 ; -use IO::Compress::Base::Common 2.074 ; +use IO::Compress::Base::Common 2.081 ; use IO::File ; use Symbol; @@ -143,11 +143,12 @@ sub smartSeek my $position = shift || SEEK_SET; # TODO -- need to take prime into account + *$self->{Prime} = ''; if (defined *$self->{FH}) { *$self->{FH}->seek($offset, $position) } else { if ($position == SEEK_END) { - *$self->{BufferOffset} = length ${ *$self->{Buffer} } + $offset ; + *$self->{BufferOffset} = length(${ *$self->{Buffer} }) + $offset ; } elsif ($position == SEEK_CUR) { *$self->{BufferOffset} += $offset ; @@ -493,6 +494,9 @@ sub _create *$obj->{InNew} = 0; *$obj->{Closed} = 0; + + return $obj + if *$obj->{Pause} ; if ($status) { # Need to try uncompressing to catch the case @@ -1120,6 +1124,7 @@ sub read if (! *$self->{AppendOutput}) { if (! $offset) { + $$buffer = '' ; } else { @@ -1518,7 +1523,7 @@ __END__ =head1 NAME -IO::Uncompress::Base - Base Class for IO::Uncompress modules +IO::Uncompress::Base - Base Class for IO::Uncompress modules =head1 SYNOPSIS @@ -1541,7 +1546,7 @@ L<IO::Zlib|IO::Zlib> =head1 AUTHOR -This module was written by Paul Marquess, C<pmqs@cpan.org>. +This module was written by Paul Marquess, C<pmqs@cpan.org>. =head1 MODIFICATION HISTORY @@ -1549,7 +1554,7 @@ See the Changes file. =head1 COPYRIGHT AND LICENSE -Copyright (c) 2005-2017 Paul Marquess. All rights reserved. +Copyright (c) 2005-2018 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/IO/Uncompress/Bunzip2.pm b/cpan/IO-Compress/lib/IO/Uncompress/Bunzip2.pm index 26556b7625..ec17c63c6c 100644 --- a/cpan/IO-Compress/lib/IO/Uncompress/Bunzip2.pm +++ b/cpan/IO-Compress/lib/IO/Uncompress/Bunzip2.pm @@ -4,15 +4,15 @@ use strict ; use warnings; use bytes; -use IO::Compress::Base::Common 2.074 qw(:Status ); +use IO::Compress::Base::Common 2.081 qw(:Status ); -use IO::Uncompress::Base 2.074 ; -use IO::Uncompress::Adapter::Bunzip2 2.074 ; +use IO::Uncompress::Base 2.081 ; +use IO::Uncompress::Adapter::Bunzip2 2.081 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $Bunzip2Error); -$VERSION = '2.074'; +$VERSION = '2.081'; $Bunzip2Error = ''; @ISA = qw(IO::Uncompress::Base Exporter); @@ -149,7 +149,7 @@ IO::Uncompress::Bunzip2 - Read bzip2 files/buffers my $status = bunzip2 $input => $output [,OPTS] or die "bunzip2 failed: $Bunzip2Error\n"; - my $z = new IO::Uncompress::Bunzip2 $input [OPTS] + my $z = new IO::Uncompress::Bunzip2 $input [OPTS] or die "bunzip2 failed: $Bunzip2Error\n"; $status = $z->read($buffer) @@ -201,7 +201,7 @@ section. use IO::Uncompress::Bunzip2 qw(bunzip2 $Bunzip2Error) ; - bunzip2 $input_filename_or_reference => $output_filename_or_reference [,OPTS] + bunzip2 $input_filename_or_reference => $output_filename_or_reference [,OPTS] or die "bunzip2 failed: $Bunzip2Error\n"; The functional interface needs Perl5.005 or better. @@ -214,7 +214,7 @@ C<$input_filename_or_reference> and C<$output_filename_or_reference>. =head3 The C<$input_filename_or_reference> parameter The parameter, C<$input_filename_or_reference>, is used to define the -source of the compressed data. +source of the compressed data. It can take one of the following forms: @@ -232,17 +232,17 @@ If the C<$input_filename_or_reference> parameter is a filehandle, the input data will be read from it. The string '-' can be used as an alias for standard input. -=item A scalar reference +=item A scalar reference If C<$input_filename_or_reference> is a scalar reference, the input data will be read from C<$$input_filename_or_reference>. -=item An array reference +=item An array reference If C<$input_filename_or_reference> is an array reference, each element in the array must be a filename. -The input data will be read from each file in turn. +The input data will be read from each file in turn. The complete array will be walked to ensure that it only contains valid filenames before any data is uncompressed. @@ -250,8 +250,8 @@ contains valid filenames before any data is uncompressed. =item An Input FileGlob string If C<$input_filename_or_reference> is a string that is delimited by the -characters "<" and ">" C<bunzip2> will assume that it is an -I<input fileglob string>. The input is the list of files that match the +characters "<" and ">" C<bunzip2> will assume that it is an +I<input fileglob string>. The input is the list of files that match the fileglob. See L<File::GlobMapper|File::GlobMapper> for more details. @@ -272,7 +272,7 @@ these forms. =item A filename If the C<$output_filename_or_reference> parameter is a simple scalar, it is -assumed to be a filename. This file will be opened for writing and the +assumed to be a filename. This file will be opened for writing and the uncompressed data will be written to it. =item A filehandle @@ -281,14 +281,14 @@ If the C<$output_filename_or_reference> parameter is a filehandle, the uncompressed data will be written to it. The string '-' can be used as an alias for standard output. -=item A scalar reference +=item A scalar reference If C<$output_filename_or_reference> is a scalar reference, the uncompressed data will be stored in C<$$output_filename_or_reference>. =item An Array Reference -If C<$output_filename_or_reference> is an array reference, +If C<$output_filename_or_reference> is an array reference, the uncompressed data will be pushed onto the array. =item An Output FileGlob @@ -327,7 +327,7 @@ L</"Constructor Options"> section below. =item C<< AutoClose => 0|1 >> -This option applies to any input or output data streams to +This option applies to any input or output data streams to C<bunzip2> that are filehandles. If C<AutoClose> is specified, and the value is true, it will result in all @@ -370,7 +370,7 @@ written to it. Otherwise the file pointer will not be moved. =back -When C<Append> is specified, and set to true, it will I<append> all uncompressed +When C<Append> is specified, and set to true, it will I<append> all uncompressed data to the output data stream. So when the output is a filehandle it will carry out a seek to the eof @@ -398,7 +398,7 @@ Defaults to 0. =item C<< TrailingData => $scalar >> Returns the data, if any, that is present immediately after the compressed -data stream once uncompression is complete. +data stream once uncompression is complete. This option can be used when there is useful information immediately following the compressed data stream, and you don't know the length of the @@ -410,7 +410,7 @@ end of the compressed data stream to the end of the buffer. If the input is a filehandle, C<trailingData> will return the data that is left in the filehandle input buffer once the end of the compressed data stream has been reached. You can then use the filehandle to read the rest -of the input file. +of the input file. Don't bother using C<trailingData> if the input is a filename. @@ -445,7 +445,7 @@ uncompressed data to a buffer, C<$buffer>. my $input = new IO::File "<file1.txt.bz2" or die "Cannot open 'file1.txt.bz2': $!\n" ; my $buffer ; - bunzip2 $input => \$buffer + bunzip2 $input => \$buffer or die "bunzip2 failed: $Bunzip2Error\n"; To uncompress all files in the directory "/my/home" that match "*.txt.bz2" and store the compressed data in the same directory @@ -467,7 +467,7 @@ and if you want to compress each file one at a time, this will do the trick { my $output = $input; $output =~ s/.bz2// ; - bunzip2 $input => $output + bunzip2 $input => $output or die "Error compressing '$input': $Bunzip2Error\n"; } @@ -508,7 +508,7 @@ If the C<$input> parameter is a filehandle, the compressed data will be read from it. The string '-' can be used as an alias for standard input. -=item A scalar reference +=item A scalar reference If C<$input> is a scalar reference, the compressed data will be read from C<$$input>. @@ -583,7 +583,7 @@ When present this option will limit the number of compressed bytes read from the input file/buffer to C<$size>. This option can be used in the situation where there is useful data directly after the compressed data stream and you know beforehand the exact length of the compressed data -stream. +stream. This option is mostly used when reading from a filehandle, in which case the file pointer will be left pointing to the first byte directly after the @@ -611,7 +611,7 @@ This option is a no-op. When non-zero this options will make bzip2 use a decompression algorithm that uses less memory at the expense of increasing the amount of time -taken for decompression. +taken for decompression. Default is 0. @@ -621,7 +621,7 @@ Default is 0. TODO -=head1 Methods +=head1 Methods =head2 read @@ -665,16 +665,16 @@ Usage is $line = $z->getline() $line = <$z> -Reads a single line. +Reads a single line. This method fully supports the use of the variable C<$/> (or C<$INPUT_RECORD_SEPARATOR> or C<$RS> when C<English> is in use) to determine what constitutes an end of line. Paragraph mode, record mode and -file slurp mode are all supported. +file slurp mode are all supported. =head2 getc -Usage is +Usage is $char = $z->getc() @@ -749,7 +749,7 @@ This is a noop provided for completeness. $z->opened() -Returns true if the object currently refers to a opened file/buffer. +Returns true if the object currently refers to a opened file/buffer. =head2 autoflush @@ -796,7 +796,7 @@ C<undef>. $z->close() ; close $z ; -Closes the output file/buffer. +Closes the output file/buffer. For most versions of Perl this method will be automatically invoked if the IO::Uncompress::Bunzip2 object is destroyed (either explicitly or by the @@ -850,7 +850,7 @@ end of the compressed data stream to the end of the buffer. If the input is a filehandle, C<trailingData> will return the data that is left in the filehandle input buffer once the end of the compressed data stream has been reached. You can then use the filehandle to read the rest -of the input file. +of the input file. Don't bother using C<trailingData> if the input is a filename. @@ -858,9 +858,9 @@ If you know the length of the compressed data stream before you start uncompressing, you can avoid having to use C<trailingData> by setting the C<InputLength> option in the constructor. -=head1 Importing +=head1 Importing -No symbolic constants are required by this IO::Uncompress::Bunzip2 at present. +No symbolic constants are required by this IO::Uncompress::Bunzip2 at present. =over 5 @@ -895,7 +895,7 @@ See the module L<Compress::Bzip2|Compress::Bzip2> =head1 AUTHOR -This module was written by Paul Marquess, C<pmqs@cpan.org>. +This module was written by Paul Marquess, C<pmqs@cpan.org>. =head1 MODIFICATION HISTORY @@ -903,7 +903,7 @@ See the Changes file. =head1 COPYRIGHT AND LICENSE -Copyright (c) 2005-2017 Paul Marquess. All rights reserved. +Copyright (c) 2005-2018 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/IO/Uncompress/Gunzip.pm b/cpan/IO-Compress/lib/IO/Uncompress/Gunzip.pm index 90af4b1b62..55d4c0a97a 100644 --- a/cpan/IO-Compress/lib/IO/Uncompress/Gunzip.pm +++ b/cpan/IO-Compress/lib/IO/Uncompress/Gunzip.pm @@ -9,12 +9,12 @@ use strict ; use warnings; use bytes; -use IO::Uncompress::RawInflate 2.074 ; +use IO::Uncompress::RawInflate 2.081 ; -use Compress::Raw::Zlib 2.074 () ; -use IO::Compress::Base::Common 2.074 qw(:Status ); -use IO::Compress::Gzip::Constants 2.074 ; -use IO::Compress::Zlib::Extra 2.074 ; +use Compress::Raw::Zlib 2.081 () ; +use IO::Compress::Base::Common 2.081 qw(:Status ); +use IO::Compress::Gzip::Constants 2.081 ; +use IO::Compress::Zlib::Extra 2.081 ; require Exporter ; @@ -28,7 +28,7 @@ Exporter::export_ok_tags('all'); $GunzipError = ''; -$VERSION = '2.074'; +$VERSION = '2.081'; sub new { @@ -286,7 +286,7 @@ IO::Uncompress::Gunzip - Read RFC 1952 files/buffers my $status = gunzip $input => $output [,OPTS] or die "gunzip failed: $GunzipError\n"; - my $z = new IO::Uncompress::Gunzip $input [OPTS] + my $z = new IO::Uncompress::Gunzip $input [OPTS] or die "gunzip failed: $GunzipError\n"; $status = $z->read($buffer) @@ -340,7 +340,7 @@ section. use IO::Uncompress::Gunzip qw(gunzip $GunzipError) ; - gunzip $input_filename_or_reference => $output_filename_or_reference [,OPTS] + gunzip $input_filename_or_reference => $output_filename_or_reference [,OPTS] or die "gunzip failed: $GunzipError\n"; The functional interface needs Perl5.005 or better. @@ -353,7 +353,7 @@ C<$input_filename_or_reference> and C<$output_filename_or_reference>. =head3 The C<$input_filename_or_reference> parameter The parameter, C<$input_filename_or_reference>, is used to define the -source of the compressed data. +source of the compressed data. It can take one of the following forms: @@ -371,17 +371,17 @@ If the C<$input_filename_or_reference> parameter is a filehandle, the input data will be read from it. The string '-' can be used as an alias for standard input. -=item A scalar reference +=item A scalar reference If C<$input_filename_or_reference> is a scalar reference, the input data will be read from C<$$input_filename_or_reference>. -=item An array reference +=item An array reference If C<$input_filename_or_reference> is an array reference, each element in the array must be a filename. -The input data will be read from each file in turn. +The input data will be read from each file in turn. The complete array will be walked to ensure that it only contains valid filenames before any data is uncompressed. @@ -389,8 +389,8 @@ contains valid filenames before any data is uncompressed. =item An Input FileGlob string If C<$input_filename_or_reference> is a string that is delimited by the -characters "<" and ">" C<gunzip> will assume that it is an -I<input fileglob string>. The input is the list of files that match the +characters "<" and ">" C<gunzip> will assume that it is an +I<input fileglob string>. The input is the list of files that match the fileglob. See L<File::GlobMapper|File::GlobMapper> for more details. @@ -411,7 +411,7 @@ these forms. =item A filename If the C<$output_filename_or_reference> parameter is a simple scalar, it is -assumed to be a filename. This file will be opened for writing and the +assumed to be a filename. This file will be opened for writing and the uncompressed data will be written to it. =item A filehandle @@ -420,14 +420,14 @@ If the C<$output_filename_or_reference> parameter is a filehandle, the uncompressed data will be written to it. The string '-' can be used as an alias for standard output. -=item A scalar reference +=item A scalar reference If C<$output_filename_or_reference> is a scalar reference, the uncompressed data will be stored in C<$$output_filename_or_reference>. =item An Array Reference -If C<$output_filename_or_reference> is an array reference, +If C<$output_filename_or_reference> is an array reference, the uncompressed data will be pushed onto the array. =item An Output FileGlob @@ -466,7 +466,7 @@ L</"Constructor Options"> section below. =item C<< AutoClose => 0|1 >> -This option applies to any input or output data streams to +This option applies to any input or output data streams to C<gunzip> that are filehandles. If C<AutoClose> is specified, and the value is true, it will result in all @@ -509,7 +509,7 @@ written to it. Otherwise the file pointer will not be moved. =back -When C<Append> is specified, and set to true, it will I<append> all uncompressed +When C<Append> is specified, and set to true, it will I<append> all uncompressed data to the output data stream. So when the output is a filehandle it will carry out a seek to the eof @@ -537,7 +537,7 @@ Defaults to 0. =item C<< TrailingData => $scalar >> Returns the data, if any, that is present immediately after the compressed -data stream once uncompression is complete. +data stream once uncompression is complete. This option can be used when there is useful information immediately following the compressed data stream, and you don't know the length of the @@ -549,7 +549,7 @@ end of the compressed data stream to the end of the buffer. If the input is a filehandle, C<trailingData> will return the data that is left in the filehandle input buffer once the end of the compressed data stream has been reached. You can then use the filehandle to read the rest -of the input file. +of the input file. Don't bother using C<trailingData> if the input is a filename. @@ -584,7 +584,7 @@ uncompressed data to a buffer, C<$buffer>. my $input = new IO::File "<file1.txt.gz" or die "Cannot open 'file1.txt.gz': $!\n" ; my $buffer ; - gunzip $input => \$buffer + gunzip $input => \$buffer or die "gunzip failed: $GunzipError\n"; To uncompress all files in the directory "/my/home" that match "*.txt.gz" and store the compressed data in the same directory @@ -606,7 +606,7 @@ and if you want to compress each file one at a time, this will do the trick { my $output = $input; $output =~ s/.gz// ; - gunzip $input => $output + gunzip $input => $output or die "Error compressing '$input': $GunzipError\n"; } @@ -647,7 +647,7 @@ If the C<$input> parameter is a filehandle, the compressed data will be read from it. The string '-' can be used as an alias for standard input. -=item A scalar reference +=item A scalar reference If C<$input> is a scalar reference, the compressed data will be read from C<$$input>. @@ -722,7 +722,7 @@ When present this option will limit the number of compressed bytes read from the input file/buffer to C<$size>. This option can be used in the situation where there is useful data directly after the compressed data stream and you know beforehand the exact length of the compressed data -stream. +stream. This option is mostly used when reading from a filehandle, in which case the file pointer will be left pointing to the first byte directly after the @@ -752,7 +752,7 @@ The default for this option is off. =over 5 -=item 1 +=item 1 If the FHCRC bit is set in the gzip FLG header byte, the CRC16 bytes in the header must match the crc16 value of the gzip header actually read. @@ -803,7 +803,7 @@ Defaults to 0. TODO -=head1 Methods +=head1 Methods =head2 read @@ -847,16 +847,16 @@ Usage is $line = $z->getline() $line = <$z> -Reads a single line. +Reads a single line. This method fully supports the use of the variable C<$/> (or C<$INPUT_RECORD_SEPARATOR> or C<$RS> when C<English> is in use) to determine what constitutes an end of line. Paragraph mode, record mode and -file slurp mode are all supported. +file slurp mode are all supported. =head2 getc -Usage is +Usage is $char = $z->getc() @@ -955,7 +955,7 @@ This is a noop provided for completeness. $z->opened() -Returns true if the object currently refers to a opened file/buffer. +Returns true if the object currently refers to a opened file/buffer. =head2 autoflush @@ -1002,7 +1002,7 @@ C<undef>. $z->close() ; close $z ; -Closes the output file/buffer. +Closes the output file/buffer. For most versions of Perl this method will be automatically invoked if the IO::Uncompress::Gunzip object is destroyed (either explicitly or by the @@ -1056,7 +1056,7 @@ end of the compressed data stream to the end of the buffer. If the input is a filehandle, C<trailingData> will return the data that is left in the filehandle input buffer once the end of the compressed data stream has been reached. You can then use the filehandle to read the rest -of the input file. +of the input file. Don't bother using C<trailingData> if the input is a filename. @@ -1064,9 +1064,9 @@ If you know the length of the compressed data stream before you start uncompressing, you can avoid having to use C<trailingData> by setting the C<InputLength> option in the constructor. -=head1 Importing +=head1 Importing -No symbolic constants are required by this IO::Uncompress::Gunzip at present. +No symbolic constants are required by this IO::Uncompress::Gunzip at present. =over 5 @@ -1095,7 +1095,7 @@ L<File::GlobMapper|File::GlobMapper>, L<Archive::Zip|Archive::Zip>, L<Archive::Tar|Archive::Tar>, L<IO::Zlib|IO::Zlib> -For RFC 1950, 1951 and 1952 see +For RFC 1950, 1951 and 1952 see L<http://www.faqs.org/rfcs/rfc1950.html>, L<http://www.faqs.org/rfcs/rfc1951.html> and L<http://www.faqs.org/rfcs/rfc1952.html> @@ -1110,7 +1110,7 @@ The primary site for gzip is L<http://www.gzip.org>. =head1 AUTHOR -This module was written by Paul Marquess, C<pmqs@cpan.org>. +This module was written by Paul Marquess, C<pmqs@cpan.org>. =head1 MODIFICATION HISTORY @@ -1118,7 +1118,7 @@ See the Changes file. =head1 COPYRIGHT AND LICENSE -Copyright (c) 2005-2017 Paul Marquess. All rights reserved. +Copyright (c) 2005-2018 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/IO/Uncompress/Inflate.pm b/cpan/IO-Compress/lib/IO/Uncompress/Inflate.pm index 4e1b246fac..9dcd797be4 100644 --- a/cpan/IO-Compress/lib/IO/Uncompress/Inflate.pm +++ b/cpan/IO-Compress/lib/IO/Uncompress/Inflate.pm @@ -5,15 +5,15 @@ use strict ; use warnings; use bytes; -use IO::Compress::Base::Common 2.074 qw(:Status ); -use IO::Compress::Zlib::Constants 2.074 ; +use IO::Compress::Base::Common 2.081 qw(:Status ); +use IO::Compress::Zlib::Constants 2.081 ; -use IO::Uncompress::RawInflate 2.074 ; +use IO::Uncompress::RawInflate 2.081 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $InflateError); -$VERSION = '2.074'; +$VERSION = '2.081'; $InflateError = ''; @ISA = qw(IO::Uncompress::RawInflate Exporter); @@ -208,7 +208,7 @@ IO::Uncompress::Inflate - Read RFC 1950 files/buffers my $status = inflate $input => $output [,OPTS] or die "inflate failed: $InflateError\n"; - my $z = new IO::Uncompress::Inflate $input [OPTS] + my $z = new IO::Uncompress::Inflate $input [OPTS] or die "inflate failed: $InflateError\n"; $status = $z->read($buffer) @@ -262,7 +262,7 @@ section. use IO::Uncompress::Inflate qw(inflate $InflateError) ; - inflate $input_filename_or_reference => $output_filename_or_reference [,OPTS] + inflate $input_filename_or_reference => $output_filename_or_reference [,OPTS] or die "inflate failed: $InflateError\n"; The functional interface needs Perl5.005 or better. @@ -275,7 +275,7 @@ C<$input_filename_or_reference> and C<$output_filename_or_reference>. =head3 The C<$input_filename_or_reference> parameter The parameter, C<$input_filename_or_reference>, is used to define the -source of the compressed data. +source of the compressed data. It can take one of the following forms: @@ -293,17 +293,17 @@ If the C<$input_filename_or_reference> parameter is a filehandle, the input data will be read from it. The string '-' can be used as an alias for standard input. -=item A scalar reference +=item A scalar reference If C<$input_filename_or_reference> is a scalar reference, the input data will be read from C<$$input_filename_or_reference>. -=item An array reference +=item An array reference If C<$input_filename_or_reference> is an array reference, each element in the array must be a filename. -The input data will be read from each file in turn. +The input data will be read from each file in turn. The complete array will be walked to ensure that it only contains valid filenames before any data is uncompressed. @@ -311,8 +311,8 @@ contains valid filenames before any data is uncompressed. =item An Input FileGlob string If C<$input_filename_or_reference> is a string that is delimited by the -characters "<" and ">" C<inflate> will assume that it is an -I<input fileglob string>. The input is the list of files that match the +characters "<" and ">" C<inflate> will assume that it is an +I<input fileglob string>. The input is the list of files that match the fileglob. See L<File::GlobMapper|File::GlobMapper> for more details. @@ -333,7 +333,7 @@ these forms. =item A filename If the C<$output_filename_or_reference> parameter is a simple scalar, it is -assumed to be a filename. This file will be opened for writing and the +assumed to be a filename. This file will be opened for writing and the uncompressed data will be written to it. =item A filehandle @@ -342,14 +342,14 @@ If the C<$output_filename_or_reference> parameter is a filehandle, the uncompressed data will be written to it. The string '-' can be used as an alias for standard output. -=item A scalar reference +=item A scalar reference If C<$output_filename_or_reference> is a scalar reference, the uncompressed data will be stored in C<$$output_filename_or_reference>. =item An Array Reference -If C<$output_filename_or_reference> is an array reference, +If C<$output_filename_or_reference> is an array reference, the uncompressed data will be pushed onto the array. =item An Output FileGlob @@ -388,7 +388,7 @@ L</"Constructor Options"> section below. =item C<< AutoClose => 0|1 >> -This option applies to any input or output data streams to +This option applies to any input or output data streams to C<inflate> that are filehandles. If C<AutoClose> is specified, and the value is true, it will result in all @@ -431,7 +431,7 @@ written to it. Otherwise the file pointer will not be moved. =back -When C<Append> is specified, and set to true, it will I<append> all uncompressed +When C<Append> is specified, and set to true, it will I<append> all uncompressed data to the output data stream. So when the output is a filehandle it will carry out a seek to the eof @@ -459,7 +459,7 @@ Defaults to 0. =item C<< TrailingData => $scalar >> Returns the data, if any, that is present immediately after the compressed -data stream once uncompression is complete. +data stream once uncompression is complete. This option can be used when there is useful information immediately following the compressed data stream, and you don't know the length of the @@ -471,7 +471,7 @@ end of the compressed data stream to the end of the buffer. If the input is a filehandle, C<trailingData> will return the data that is left in the filehandle input buffer once the end of the compressed data stream has been reached. You can then use the filehandle to read the rest -of the input file. +of the input file. Don't bother using C<trailingData> if the input is a filename. @@ -506,7 +506,7 @@ uncompressed data to a buffer, C<$buffer>. my $input = new IO::File "<file1.txt.1950" or die "Cannot open 'file1.txt.1950': $!\n" ; my $buffer ; - inflate $input => \$buffer + inflate $input => \$buffer or die "inflate failed: $InflateError\n"; To uncompress all files in the directory "/my/home" that match "*.txt.1950" and store the compressed data in the same directory @@ -528,7 +528,7 @@ and if you want to compress each file one at a time, this will do the trick { my $output = $input; $output =~ s/.1950// ; - inflate $input => $output + inflate $input => $output or die "Error compressing '$input': $InflateError\n"; } @@ -569,7 +569,7 @@ If the C<$input> parameter is a filehandle, the compressed data will be read from it. The string '-' can be used as an alias for standard input. -=item A scalar reference +=item A scalar reference If C<$input> is a scalar reference, the compressed data will be read from C<$$input>. @@ -644,7 +644,7 @@ When present this option will limit the number of compressed bytes read from the input file/buffer to C<$size>. This option can be used in the situation where there is useful data directly after the compressed data stream and you know beforehand the exact length of the compressed data -stream. +stream. This option is mostly used when reading from a filehandle, in which case the file pointer will be left pointing to the first byte directly after the @@ -691,7 +691,7 @@ uncompressed data actually contained in the file. TODO -=head1 Methods +=head1 Methods =head2 read @@ -735,16 +735,16 @@ Usage is $line = $z->getline() $line = <$z> -Reads a single line. +Reads a single line. This method fully supports the use of the variable C<$/> (or C<$INPUT_RECORD_SEPARATOR> or C<$RS> when C<English> is in use) to determine what constitutes an end of line. Paragraph mode, record mode and -file slurp mode are all supported. +file slurp mode are all supported. =head2 getc -Usage is +Usage is $char = $z->getc() @@ -827,7 +827,7 @@ This is a noop provided for completeness. $z->opened() -Returns true if the object currently refers to a opened file/buffer. +Returns true if the object currently refers to a opened file/buffer. =head2 autoflush @@ -874,7 +874,7 @@ C<undef>. $z->close() ; close $z ; -Closes the output file/buffer. +Closes the output file/buffer. For most versions of Perl this method will be automatically invoked if the IO::Uncompress::Inflate object is destroyed (either explicitly or by the @@ -928,7 +928,7 @@ end of the compressed data stream to the end of the buffer. If the input is a filehandle, C<trailingData> will return the data that is left in the filehandle input buffer once the end of the compressed data stream has been reached. You can then use the filehandle to read the rest -of the input file. +of the input file. Don't bother using C<trailingData> if the input is a filename. @@ -936,9 +936,9 @@ If you know the length of the compressed data stream before you start uncompressing, you can avoid having to use C<trailingData> by setting the C<InputLength> option in the constructor. -=head1 Importing +=head1 Importing -No symbolic constants are required by this IO::Uncompress::Inflate at present. +No symbolic constants are required by this IO::Uncompress::Inflate at present. =over 5 @@ -967,7 +967,7 @@ L<File::GlobMapper|File::GlobMapper>, L<Archive::Zip|Archive::Zip>, L<Archive::Tar|Archive::Tar>, L<IO::Zlib|IO::Zlib> -For RFC 1950, 1951 and 1952 see +For RFC 1950, 1951 and 1952 see L<http://www.faqs.org/rfcs/rfc1950.html>, L<http://www.faqs.org/rfcs/rfc1951.html> and L<http://www.faqs.org/rfcs/rfc1952.html> @@ -982,7 +982,7 @@ The primary site for gzip is L<http://www.gzip.org>. =head1 AUTHOR -This module was written by Paul Marquess, C<pmqs@cpan.org>. +This module was written by Paul Marquess, C<pmqs@cpan.org>. =head1 MODIFICATION HISTORY @@ -990,7 +990,7 @@ See the Changes file. =head1 COPYRIGHT AND LICENSE -Copyright (c) 2005-2017 Paul Marquess. All rights reserved. +Copyright (c) 2005-2018 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/IO/Uncompress/RawInflate.pm b/cpan/IO-Compress/lib/IO/Uncompress/RawInflate.pm index 831940301d..5cf10b0bd2 100644 --- a/cpan/IO-Compress/lib/IO/Uncompress/RawInflate.pm +++ b/cpan/IO-Compress/lib/IO/Uncompress/RawInflate.pm @@ -5,16 +5,16 @@ use strict ; use warnings; use bytes; -use Compress::Raw::Zlib 2.074 ; -use IO::Compress::Base::Common 2.074 qw(:Status ); +use Compress::Raw::Zlib 2.081 ; +use IO::Compress::Base::Common 2.081 qw(:Status ); -use IO::Uncompress::Base 2.074 ; -use IO::Uncompress::Adapter::Inflate 2.074 ; +use IO::Uncompress::Base 2.081 ; +use IO::Uncompress::Adapter::Inflate 2.081 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $RawInflateError); -$VERSION = '2.074'; +$VERSION = '2.081'; $RawInflateError = ''; @ISA = qw(IO::Uncompress::Base Exporter); @@ -356,7 +356,7 @@ IO::Uncompress::RawInflate - Read RFC 1951 files/buffers my $status = rawinflate $input => $output [,OPTS] or die "rawinflate failed: $RawInflateError\n"; - my $z = new IO::Uncompress::RawInflate $input [OPTS] + my $z = new IO::Uncompress::RawInflate $input [OPTS] or die "rawinflate failed: $RawInflateError\n"; $status = $z->read($buffer) @@ -410,7 +410,7 @@ section. use IO::Uncompress::RawInflate qw(rawinflate $RawInflateError) ; - rawinflate $input_filename_or_reference => $output_filename_or_reference [,OPTS] + rawinflate $input_filename_or_reference => $output_filename_or_reference [,OPTS] or die "rawinflate failed: $RawInflateError\n"; The functional interface needs Perl5.005 or better. @@ -423,7 +423,7 @@ C<$input_filename_or_reference> and C<$output_filename_or_reference>. =head3 The C<$input_filename_or_reference> parameter The parameter, C<$input_filename_or_reference>, is used to define the -source of the compressed data. +source of the compressed data. It can take one of the following forms: @@ -441,17 +441,17 @@ If the C<$input_filename_or_reference> parameter is a filehandle, the input data will be read from it. The string '-' can be used as an alias for standard input. -=item A scalar reference +=item A scalar reference If C<$input_filename_or_reference> is a scalar reference, the input data will be read from C<$$input_filename_or_reference>. -=item An array reference +=item An array reference If C<$input_filename_or_reference> is an array reference, each element in the array must be a filename. -The input data will be read from each file in turn. +The input data will be read from each file in turn. The complete array will be walked to ensure that it only contains valid filenames before any data is uncompressed. @@ -459,8 +459,8 @@ contains valid filenames before any data is uncompressed. =item An Input FileGlob string If C<$input_filename_or_reference> is a string that is delimited by the -characters "<" and ">" C<rawinflate> will assume that it is an -I<input fileglob string>. The input is the list of files that match the +characters "<" and ">" C<rawinflate> will assume that it is an +I<input fileglob string>. The input is the list of files that match the fileglob. See L<File::GlobMapper|File::GlobMapper> for more details. @@ -481,7 +481,7 @@ these forms. =item A filename If the C<$output_filename_or_reference> parameter is a simple scalar, it is -assumed to be a filename. This file will be opened for writing and the +assumed to be a filename. This file will be opened for writing and the uncompressed data will be written to it. =item A filehandle @@ -490,14 +490,14 @@ If the C<$output_filename_or_reference> parameter is a filehandle, the uncompressed data will be written to it. The string '-' can be used as an alias for standard output. -=item A scalar reference +=item A scalar reference If C<$output_filename_or_reference> is a scalar reference, the uncompressed data will be stored in C<$$output_filename_or_reference>. =item An Array Reference -If C<$output_filename_or_reference> is an array reference, +If C<$output_filename_or_reference> is an array reference, the uncompressed data will be pushed onto the array. =item An Output FileGlob @@ -536,7 +536,7 @@ L</"Constructor Options"> section below. =item C<< AutoClose => 0|1 >> -This option applies to any input or output data streams to +This option applies to any input or output data streams to C<rawinflate> that are filehandles. If C<AutoClose> is specified, and the value is true, it will result in all @@ -579,7 +579,7 @@ written to it. Otherwise the file pointer will not be moved. =back -When C<Append> is specified, and set to true, it will I<append> all uncompressed +When C<Append> is specified, and set to true, it will I<append> all uncompressed data to the output data stream. So when the output is a filehandle it will carry out a seek to the eof @@ -604,7 +604,7 @@ This option is a no-op. =item C<< TrailingData => $scalar >> Returns the data, if any, that is present immediately after the compressed -data stream once uncompression is complete. +data stream once uncompression is complete. This option can be used when there is useful information immediately following the compressed data stream, and you don't know the length of the @@ -616,7 +616,7 @@ end of the compressed data stream to the end of the buffer. If the input is a filehandle, C<trailingData> will return the data that is left in the filehandle input buffer once the end of the compressed data stream has been reached. You can then use the filehandle to read the rest -of the input file. +of the input file. Don't bother using C<trailingData> if the input is a filename. @@ -651,7 +651,7 @@ uncompressed data to a buffer, C<$buffer>. my $input = new IO::File "<file1.txt.1951" or die "Cannot open 'file1.txt.1951': $!\n" ; my $buffer ; - rawinflate $input => \$buffer + rawinflate $input => \$buffer or die "rawinflate failed: $RawInflateError\n"; To uncompress all files in the directory "/my/home" that match "*.txt.1951" and store the compressed data in the same directory @@ -673,7 +673,7 @@ and if you want to compress each file one at a time, this will do the trick { my $output = $input; $output =~ s/.1951// ; - rawinflate $input => $output + rawinflate $input => $output or die "Error compressing '$input': $RawInflateError\n"; } @@ -714,7 +714,7 @@ If the C<$input> parameter is a filehandle, the compressed data will be read from it. The string '-' can be used as an alias for standard input. -=item A scalar reference +=item A scalar reference If C<$input> is a scalar reference, the compressed data will be read from C<$$input>. @@ -789,7 +789,7 @@ When present this option will limit the number of compressed bytes read from the input file/buffer to C<$size>. This option can be used in the situation where there is useful data directly after the compressed data stream and you know beforehand the exact length of the compressed data -stream. +stream. This option is mostly used when reading from a filehandle, in which case the file pointer will be left pointing to the first byte directly after the @@ -819,7 +819,7 @@ This option is a no-op. TODO -=head1 Methods +=head1 Methods =head2 read @@ -863,16 +863,16 @@ Usage is $line = $z->getline() $line = <$z> -Reads a single line. +Reads a single line. This method fully supports the use of the variable C<$/> (or C<$INPUT_RECORD_SEPARATOR> or C<$RS> when C<English> is in use) to determine what constitutes an end of line. Paragraph mode, record mode and -file slurp mode are all supported. +file slurp mode are all supported. =head2 getc -Usage is +Usage is $char = $z->getc() @@ -955,7 +955,7 @@ This is a noop provided for completeness. $z->opened() -Returns true if the object currently refers to a opened file/buffer. +Returns true if the object currently refers to a opened file/buffer. =head2 autoflush @@ -1002,7 +1002,7 @@ C<undef>. $z->close() ; close $z ; -Closes the output file/buffer. +Closes the output file/buffer. For most versions of Perl this method will be automatically invoked if the IO::Uncompress::RawInflate object is destroyed (either explicitly or by the @@ -1056,7 +1056,7 @@ end of the compressed data stream to the end of the buffer. If the input is a filehandle, C<trailingData> will return the data that is left in the filehandle input buffer once the end of the compressed data stream has been reached. You can then use the filehandle to read the rest -of the input file. +of the input file. Don't bother using C<trailingData> if the input is a filename. @@ -1064,9 +1064,9 @@ If you know the length of the compressed data stream before you start uncompressing, you can avoid having to use C<trailingData> by setting the C<InputLength> option in the constructor. -=head1 Importing +=head1 Importing -No symbolic constants are required by this IO::Uncompress::RawInflate at present. +No symbolic constants are required by this IO::Uncompress::RawInflate at present. =over 5 @@ -1095,7 +1095,7 @@ L<File::GlobMapper|File::GlobMapper>, L<Archive::Zip|Archive::Zip>, L<Archive::Tar|Archive::Tar>, L<IO::Zlib|IO::Zlib> -For RFC 1950, 1951 and 1952 see +For RFC 1950, 1951 and 1952 see L<http://www.faqs.org/rfcs/rfc1950.html>, L<http://www.faqs.org/rfcs/rfc1951.html> and L<http://www.faqs.org/rfcs/rfc1952.html> @@ -1110,7 +1110,7 @@ The primary site for gzip is L<http://www.gzip.org>. =head1 AUTHOR -This module was written by Paul Marquess, C<pmqs@cpan.org>. +This module was written by Paul Marquess, C<pmqs@cpan.org>. =head1 MODIFICATION HISTORY @@ -1118,7 +1118,7 @@ See the Changes file. =head1 COPYRIGHT AND LICENSE -Copyright (c) 2005-2017 Paul Marquess. All rights reserved. +Copyright (c) 2005-2018 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/IO/Uncompress/Unzip.pm b/cpan/IO-Compress/lib/IO/Uncompress/Unzip.pm index 5a35e018a6..9b8399eeaf 100644 --- a/cpan/IO-Compress/lib/IO/Uncompress/Unzip.pm +++ b/cpan/IO-Compress/lib/IO/Uncompress/Unzip.pm @@ -9,14 +9,14 @@ use warnings; use bytes; use IO::File; -use IO::Uncompress::RawInflate 2.074 ; -use IO::Compress::Base::Common 2.074 qw(:Status ); -use IO::Uncompress::Adapter::Inflate 2.074 ; -use IO::Uncompress::Adapter::Identity 2.074 ; -use IO::Compress::Zlib::Extra 2.074 ; -use IO::Compress::Zip::Constants 2.074 ; +use IO::Uncompress::RawInflate 2.081 ; +use IO::Compress::Base::Common 2.081 qw(:Status ); +use IO::Uncompress::Adapter::Inflate 2.081 ; +use IO::Uncompress::Adapter::Identity 2.081 ; +use IO::Compress::Zlib::Extra 2.081 ; +use IO::Compress::Zip::Constants 2.081 ; -use Compress::Raw::Zlib 2.074 () ; +use Compress::Raw::Zlib 2.081 () ; BEGIN { @@ -31,7 +31,7 @@ require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $UnzipError, %headerLookup); -$VERSION = '2.074'; +$VERSION = '2.081'; $UnzipError = ''; @ISA = qw(IO::Uncompress::RawInflate Exporter); @@ -1042,7 +1042,7 @@ IO::Uncompress::Unzip - Read zip files/buffers my $status = unzip $input => $output [,OPTS] or die "unzip failed: $UnzipError\n"; - my $z = new IO::Uncompress::Unzip $input [OPTS] + my $z = new IO::Uncompress::Unzip $input [OPTS] or die "unzip failed: $UnzipError\n"; $status = $z->read($buffer) @@ -1096,7 +1096,7 @@ section. use IO::Uncompress::Unzip qw(unzip $UnzipError) ; - unzip $input_filename_or_reference => $output_filename_or_reference [,OPTS] + unzip $input_filename_or_reference => $output_filename_or_reference [,OPTS] or die "unzip failed: $UnzipError\n"; The functional interface needs Perl5.005 or better. @@ -1109,7 +1109,7 @@ C<$input_filename_or_reference> and C<$output_filename_or_reference>. =head3 The C<$input_filename_or_reference> parameter The parameter, C<$input_filename_or_reference>, is used to define the -source of the compressed data. +source of the compressed data. It can take one of the following forms: @@ -1127,17 +1127,17 @@ If the C<$input_filename_or_reference> parameter is a filehandle, the input data will be read from it. The string '-' can be used as an alias for standard input. -=item A scalar reference +=item A scalar reference If C<$input_filename_or_reference> is a scalar reference, the input data will be read from C<$$input_filename_or_reference>. -=item An array reference +=item An array reference If C<$input_filename_or_reference> is an array reference, each element in the array must be a filename. -The input data will be read from each file in turn. +The input data will be read from each file in turn. The complete array will be walked to ensure that it only contains valid filenames before any data is uncompressed. @@ -1145,8 +1145,8 @@ contains valid filenames before any data is uncompressed. =item An Input FileGlob string If C<$input_filename_or_reference> is a string that is delimited by the -characters "<" and ">" C<unzip> will assume that it is an -I<input fileglob string>. The input is the list of files that match the +characters "<" and ">" C<unzip> will assume that it is an +I<input fileglob string>. The input is the list of files that match the fileglob. See L<File::GlobMapper|File::GlobMapper> for more details. @@ -1167,7 +1167,7 @@ these forms. =item A filename If the C<$output_filename_or_reference> parameter is a simple scalar, it is -assumed to be a filename. This file will be opened for writing and the +assumed to be a filename. This file will be opened for writing and the uncompressed data will be written to it. =item A filehandle @@ -1176,14 +1176,14 @@ If the C<$output_filename_or_reference> parameter is a filehandle, the uncompressed data will be written to it. The string '-' can be used as an alias for standard output. -=item A scalar reference +=item A scalar reference If C<$output_filename_or_reference> is a scalar reference, the uncompressed data will be stored in C<$$output_filename_or_reference>. =item An Array Reference -If C<$output_filename_or_reference> is an array reference, +If C<$output_filename_or_reference> is an array reference, the uncompressed data will be pushed onto the array. =item An Output FileGlob @@ -1222,7 +1222,7 @@ L</"Constructor Options"> section below. =item C<< AutoClose => 0|1 >> -This option applies to any input or output data streams to +This option applies to any input or output data streams to C<unzip> that are filehandles. If C<AutoClose> is specified, and the value is true, it will result in all @@ -1265,7 +1265,7 @@ written to it. Otherwise the file pointer will not be moved. =back -When C<Append> is specified, and set to true, it will I<append> all uncompressed +When C<Append> is specified, and set to true, it will I<append> all uncompressed data to the output data stream. So when the output is a filehandle it will carry out a seek to the eof @@ -1293,7 +1293,7 @@ Defaults to 0. =item C<< TrailingData => $scalar >> Returns the data, if any, that is present immediately after the compressed -data stream once uncompression is complete. +data stream once uncompression is complete. This option can be used when there is useful information immediately following the compressed data stream, and you don't know the length of the @@ -1305,7 +1305,7 @@ end of the compressed data stream to the end of the buffer. If the input is a filehandle, C<trailingData> will return the data that is left in the filehandle input buffer once the end of the compressed data stream has been reached. You can then use the filehandle to read the rest -of the input file. +of the input file. Don't bother using C<trailingData> if the input is a filename. @@ -1331,7 +1331,7 @@ file C<file1.txt> like this. or die "unzip failed: $UnzipError\n"; If you have a zip file that contains multiple members and want to read a -specific member from the file, say C<"data1">, use the C<Name> option +specific member from the file, say C<"data1">, use the C<Name> option use strict ; use warnings ; @@ -1366,7 +1366,7 @@ uncompressed data to a buffer, C<$buffer>. my $input = new IO::File "<file1.zip" or die "Cannot open 'file1.zip': $!\n" ; my $buffer ; - unzip $input => \$buffer + unzip $input => \$buffer or die "unzip failed: $UnzipError\n"; =head1 OO Interface @@ -1406,7 +1406,7 @@ If the C<$input> parameter is a filehandle, the compressed data will be read from it. The string '-' can be used as an alias for standard input. -=item A scalar reference +=item A scalar reference If C<$input> is a scalar reference, the compressed data will be read from C<$$input>. @@ -1429,7 +1429,7 @@ OPTS is a combination of the following options: =item C<< Name => "membername" >> -Open "membername" from the zip file for reading. +Open "membername" from the zip file for reading. =item C<< AutoClose => 0|1 >> @@ -1484,7 +1484,7 @@ When present this option will limit the number of compressed bytes read from the input file/buffer to C<$size>. This option can be used in the situation where there is useful data directly after the compressed data stream and you know beforehand the exact length of the compressed data -stream. +stream. This option is mostly used when reading from a filehandle, in which case the file pointer will be left pointing to the first byte directly after the @@ -1518,7 +1518,7 @@ The default for this option is off. TODO -=head1 Methods +=head1 Methods =head2 read @@ -1562,16 +1562,16 @@ Usage is $line = $z->getline() $line = <$z> -Reads a single line. +Reads a single line. This method fully supports the use of the variable C<$/> (or C<$INPUT_RECORD_SEPARATOR> or C<$RS> when C<English> is in use) to determine what constitutes an end of line. Paragraph mode, record mode and -file slurp mode are all supported. +file slurp mode are all supported. =head2 getc -Usage is +Usage is $char = $z->getc() @@ -1654,7 +1654,7 @@ This is a noop provided for completeness. $z->opened() -Returns true if the object currently refers to a opened file/buffer. +Returns true if the object currently refers to a opened file/buffer. =head2 autoflush @@ -1701,7 +1701,7 @@ C<undef>. $z->close() ; close $z ; -Closes the output file/buffer. +Closes the output file/buffer. For most versions of Perl this method will be automatically invoked if the IO::Uncompress::Unzip object is destroyed (either explicitly or by the @@ -1755,7 +1755,7 @@ end of the compressed data stream to the end of the buffer. If the input is a filehandle, C<trailingData> will return the data that is left in the filehandle input buffer once the end of the compressed data stream has been reached. You can then use the filehandle to read the rest -of the input file. +of the input file. Don't bother using C<trailingData> if the input is a filename. @@ -1763,9 +1763,9 @@ If you know the length of the compressed data stream before you start uncompressing, you can avoid having to use C<trailingData> by setting the C<InputLength> option in the constructor. -=head1 Importing +=head1 Importing -No symbolic constants are required by this IO::Uncompress::Unzip at present. +No symbolic constants are required by this IO::Uncompress::Unzip at present. =over 5 @@ -1838,7 +1838,7 @@ L<File::GlobMapper|File::GlobMapper>, L<Archive::Zip|Archive::Zip>, L<Archive::Tar|Archive::Tar>, L<IO::Zlib|IO::Zlib> -For RFC 1950, 1951 and 1952 see +For RFC 1950, 1951 and 1952 see L<http://www.faqs.org/rfcs/rfc1950.html>, L<http://www.faqs.org/rfcs/rfc1951.html> and L<http://www.faqs.org/rfcs/rfc1952.html> @@ -1853,7 +1853,7 @@ The primary site for gzip is L<http://www.gzip.org>. =head1 AUTHOR -This module was written by Paul Marquess, C<pmqs@cpan.org>. +This module was written by Paul Marquess, C<pmqs@cpan.org>. =head1 MODIFICATION HISTORY @@ -1861,7 +1861,7 @@ See the Changes file. =head1 COPYRIGHT AND LICENSE -Copyright (c) 2005-2017 Paul Marquess. All rights reserved. +Copyright (c) 2005-2018 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. |