CHANGES
-------
+ 2.012 15 July 2008
+
+ * Document the gzip flags that WindowBits can take.
+
+ * Allow a dictionary to be used with a raw inflate.
+ Needs zlib 1.2.2.1 or better.
+ [RT #36046]
+
2.011 5 May 2008
* A C++-style comment sneaked in with the last update. Fixed.
Compress-Raw-Zlib
- Version 2.011
+ Version 2.012
- 17th May 2008
+ 15th July 2008
Copyright (c) 2005-2008 Paul Marquess. All rights reserved.
This program is free software; you can redistribute it
If you haven't installed Compress-Raw-Zlib then search Compress::Raw::Zlib.pm
for a line like this:
- $VERSION = "2.011" ;
+ $VERSION = "2.012" ;
c. The version of zlib you have used.
If you have successfully installed Compress-Raw-Zlib, this one-liner
# define AT_LEAST_ZLIB_1_2_2_1
#endif
+#if defined(ZLIB_VERNUM) && ZLIB_VERNUM >= 0x1222
+# define AT_LEAST_ZLIB_1_2_2_2
+#endif
+
#if defined(ZLIB_VERNUM) && ZLIB_VERNUM >= 0x1223
# define AT_LEAST_ZLIB_1_2_2_3
#endif
s = NULL ;
}
else if (SvCUR(dictionary)) {
+#ifdef AT_LEAST_ZLIB_1_2_2_1
+ /* Zlib 1.2.2.1 or better allows a dictionary with raw inflate */
+ if (s->WindowBits < 0) {
+ err = inflateSetDictionary(&(s->stream),
+ (const Bytef*)SvPVbyte_nolen(dictionary),
+ SvCUR(dictionary));
+ if (err != Z_OK) {
+ Safefree(s) ;
+ s = NULL ;
+ }
+ }
+ else
+#endif
/* Dictionary specified - take a copy for use in inflate */
s->dictionary = newSVsv(dictionary) ;
}
}
s->bytesInflated = 0;
- while (1) {
+ RETVAL = Z_OK;
+ while (RETVAL == Z_OK) {
if (s->stream.avail_out == 0 ) {
/* out of space in the output buffer so make it bigger */
Sv_Grow(output, SvLEN(output) + bufinc) ;
SvCUR(s->dictionary));
}
- if (RETVAL != Z_OK)
- break;
}
#ifdef NEED_DUMMY_BYTE_AT_END
if (eof && RETVAL == Z_OK) {
use bytes ;
our ($VERSION, $XS_VERSION, @ISA, @EXPORT, $AUTOLOAD);
-$VERSION = '2.011';
+$VERSION = '2.012';
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
Z_SYNC_FLUSH
Z_UNKNOWN
Z_VERSION_ERROR
+
+ WANT_GZIP
+ WANT_GZIP_OR_ZLIB
);
+use constant WANT_GZIP => 16;
+use constant WANT_GZIP_OR_ZLIB => 32;
sub AUTOLOAD {
my($constname);
$flags |= FLAG_CRC if $got->value('CRC32') ;
$flags |= FLAG_ADLER if $got->value('ADLER32') ;
+ my $windowBits = $got->value('WindowBits');
+ $windowBits += MAX_WBITS()
+ if ($windowBits & MAX_WBITS()) == 0 ;
+
_deflateInit($flags,
$got->value('Level'),
$got->value('Method'),
- $got->value('WindowBits'),
+ $windowBits,
$got->value('MemLevel'),
$got->value('Strategy'),
$got->value('Bufsize'),
$flags |= FLAG_ADLER if $got->value('ADLER32') ;
$flags |= FLAG_CONSUME_INPUT if $got->value('ConsumeInput') ;
- _inflateInit($flags, $got->value('WindowBits'), $got->value('Bufsize'),
+ my $windowBits = $got->value('WindowBits');
+ $windowBits += MAX_WBITS()
+ if ($windowBits & MAX_WBITS()) == 0 ;
+
+ _inflateInit($flags, $windowBits, $got->value('Bufsize'),
$got->value('Dictionary')) ;
}
C<Z_NO_COMPRESSION>, C<Z_BEST_SPEED>, C<Z_BEST_COMPRESSION>, and
C<Z_DEFAULT_COMPRESSION>.
-The default is Z_DEFAULT_COMPRESSION.
+The default is C<Z_DEFAULT_COMPRESSION>.
=item B<-Method>
=item B<-WindowBits>
+To compress an RFC 1950 data stream, set C<WindowBits> to a positive
+number between 8 and 15.
+
+To compress an RFC 1951 data stream, set C<WindowBits> to C<-MAX_WBITS>.
+
+To compress an RFC 1952 data stream (i.e. gzip), set C<WindowBits> to
+C<WANT_GZIP>.
+
For a definition of the meaning and valid values for C<WindowBits>
refer to the I<zlib> documentation for I<deflateInit2>.
-Defaults to MAX_WBITS.
+Defaults to C<MAX_WBITS>.
=item B<-MemLevel>
=item B<-WindowBits>
To uncompress an RFC 1950 data stream, set C<WindowBits> to a positive
-number.
+number between 8 and 15.
To uncompress an RFC 1951 data stream, set C<WindowBits> to C<-MAX_WBITS>.
+To uncompress an RFC 1952 data stream (i.e. gzip), set C<WindowBits> to
+C<WANT_GZIP>.
+
+To auto-detect and uncompress an RFC 1950 or RFC 1952 data stream (i.e.
+gzip), set C<WindowBits> to C<WANT_GZIP_OR_ZLIB>.
+
For a full definition of the meaning and valid values for C<WindowBits>
refer to the I<zlib> documentation for I<inflateInit2>.
-Defaults to MAX_WBITS.
+Defaults to C<MAX_WBITS>.
=item B<-Bufsize>
my @files = getPerlFiles('MANIFEST');
+ # Note: Once you remove all the layers of shell/makefile escaping
+ # the regular expression below reads
+ #
+ # /^\s*local\s*\(\s*\$^W\s*\)/
+ #
my $postamble = '
MyTrebleCheck:
my $count = 0 ;
if ($] < 5.005) {
- $count = 189 ;
+ $count = 229 ;
}
elsif ($] >= 5.006) {
- $count = 243 ;
+ $count = 283 ;
}
else {
- $count = 201 ;
+ $count = 241 ;
}
plan tests => $count + $extra;
ok 1, "resetLastBlockByte(undef) is ok" ;
}
+{
+
+ title "gzip mode";
+ # ================
+
+ my $hello = "I am a HAL 9000 computer" ;
+ my @hello = split('', $hello) ;
+ my ($err, $x, $X, $status);
+
+ ok( ($x, $err) = new Compress::Raw::Zlib::Deflate (
+ WindowBits => WANT_GZIP ,
+ AppendOutput => 1
+ ), "Create deflate object" );
+ ok $x, "Compress::Raw::Zlib::Deflate ok" ;
+ cmp_ok $err, '==', Z_OK, "status is Z_OK" ;
+
+ $status = $x->deflate($hello, $X) ;
+ cmp_ok $status, '==', Z_OK, "deflate returned Z_OK" ;
+
+ cmp_ok $x->flush($X), '==', Z_OK, "flush returned Z_OK" ;
+
+ my ($k, $GOT);
+ ($k, $err) = new Compress::Raw::Zlib::Inflate(
+ WindowBits => WANT_GZIP ,
+ ConsumeInput => 0 ,
+ AppendOutput => 1);
+ ok $k, "Compress::Raw::Zlib::Inflate WANT_GZIP ok" ;
+ cmp_ok $err, '==', Z_OK, "status is Z_OK" ;
+
+ $status = $k->inflate($X, $GOT) ;
+ cmp_ok $status, '==', Z_STREAM_END, "Got Z_STREAM_END" ;
+ is $GOT, $hello, "uncompressed data matches ok" ;
+
+ $GOT = '';
+ ($k, $err) = new Compress::Raw::Zlib::Inflate(
+ WindowBits => WANT_GZIP_OR_ZLIB ,
+ AppendOutput => 1);
+ ok $k, "Compress::Raw::Zlib::Inflate WANT_GZIP_OR_ZLIB ok" ;
+ cmp_ok $err, '==', Z_OK, "status is Z_OK" ;
+
+ $status = $k->inflate($X, $GOT) ;
+ cmp_ok $status, '==', Z_STREAM_END, "Got Z_STREAM_END" ;
+ is $GOT, $hello, "uncompressed data matches ok" ;
+}
+
+{
+
+ title "gzip error mode";
+ # Create gzip -
+ # read with no special windowbits setting - this will fail
+ # then read with WANT_GZIP_OR_ZLIB - thi swill work
+ # ================
+
+ my $hello = "I am a HAL 9000 computer" ;
+ my ($err, $x, $X, $status);
+
+ ok( ($x, $err) = new Compress::Raw::Zlib::Deflate (
+ WindowBits => WANT_GZIP ,
+ AppendOutput => 1
+ ), "Create deflate object" );
+ ok $x, "Compress::Raw::Zlib::Deflate ok" ;
+ cmp_ok $err, '==', Z_OK, "status is Z_OK" ;
+
+ $status = $x->deflate($hello, $X) ;
+ cmp_ok $status, '==', Z_OK, "deflate returned Z_OK" ;
+
+ cmp_ok $x->flush($X), '==', Z_OK, "flush returned Z_OK" ;
+
+ my ($k, $GOT);
+ ($k, $err) = new Compress::Raw::Zlib::Inflate(
+ WindowBits => MAX_WBITS ,
+ ConsumeInput => 0 ,
+ AppendOutput => 1);
+ ok $k, "Compress::Raw::Zlib::Inflate WANT_GZIP ok" ;
+ cmp_ok $err, '==', Z_OK, "status is Z_OK" ;
+
+ $status = $k->inflate($X, $GOT) ;
+ cmp_ok $status, '==', Z_DATA_ERROR, "Got Z_DATA_ERROR" ;
+
+ $GOT = '';
+ ($k, $err) = new Compress::Raw::Zlib::Inflate(
+ WindowBits => WANT_GZIP_OR_ZLIB ,
+ AppendOutput => 1);
+ ok $k, "Compress::Raw::Zlib::Inflate WANT_GZIP_OR_ZLIB ok" ;
+ cmp_ok $err, '==', Z_OK, "status is Z_OK" ;
+
+ $status = $k->inflate($X, $GOT) ;
+ cmp_ok $status, '==', Z_STREAM_END, "Got Z_STREAM_END" ;
+ is $GOT, $hello, "uncompressed data matches ok" ;
+}
+
+{
+
+ title "gzip/zlib error mode";
+ # Create zlib -
+ # read with no WANT_GZIP windowbits setting - this will fail
+ # then read with WANT_GZIP_OR_ZLIB - thi swill work
+ # ================
+
+ my $hello = "I am a HAL 9000 computer" ;
+ my ($err, $x, $X, $status);
+
+ ok( ($x, $err) = new Compress::Raw::Zlib::Deflate (
+ AppendOutput => 1
+ ), "Create deflate object" );
+ ok $x, "Compress::Raw::Zlib::Deflate ok" ;
+ cmp_ok $err, '==', Z_OK, "status is Z_OK" ;
+
+ $status = $x->deflate($hello, $X) ;
+ cmp_ok $status, '==', Z_OK, "deflate returned Z_OK" ;
+
+ cmp_ok $x->flush($X), '==', Z_OK, "flush returned Z_OK" ;
+
+ my ($k, $GOT);
+ ($k, $err) = new Compress::Raw::Zlib::Inflate(
+ WindowBits => WANT_GZIP ,
+ ConsumeInput => 0 ,
+ AppendOutput => 1);
+ ok $k, "Compress::Raw::Zlib::Inflate WANT_GZIP ok" ;
+ cmp_ok $err, '==', Z_OK, "status is Z_OK" ;
+
+ $status = $k->inflate($X, $GOT) ;
+ cmp_ok $status, '==', Z_DATA_ERROR, "Got Z_DATA_ERROR" ;
+
+ $GOT = '';
+ ($k, $err) = new Compress::Raw::Zlib::Inflate(
+ WindowBits => WANT_GZIP_OR_ZLIB ,
+ AppendOutput => 1);
+ ok $k, "Compress::Raw::Zlib::Inflate WANT_GZIP_OR_ZLIB ok" ;
+ cmp_ok $err, '==', Z_OK, "status is Z_OK" ;
+
+ $status = $k->inflate($X, $GOT) ;
+ cmp_ok $status, '==', Z_STREAM_END, "Got Z_STREAM_END" ;
+ is $GOT, $hello, "uncompressed data matches ok" ;
+}
+
exit if $] < 5.006 ;
title 'Looping Append test with substr output - substr the end of the string';
CHANGES
-------
+ 2.012 15 July 2008
+
+ * No Changes
+
2.011 17 May 2008
* No Changes
use strict ;
require 5.004 ;
-$::VERSION = '2.011' ;
+$::VERSION = '2.012' ;
use private::MakeUtil;
use ExtUtils::MakeMaker 5.16 ;
Compress-Zlib
- Version 2.011
+ Version 2.012
- 17th May 2008
+ 15th July 2008
Copyright (c) 1995-2008 Paul Marquess. All rights reserved.
This program is free software; you can redistribute it
If you haven't installed Compress-Zlib then search Compress::Zlib.pm
for a line like this:
- $VERSION = "2.011" ;
+ $VERSION = "2.012" ;
2. If you are having problems building Compress-Zlib, send me a
complete log of what happened. Start by unpacking the Compress-Zlib
use IO::Handle ;
use Scalar::Util qw(dualvar);
-use IO::Compress::Base::Common 2.011 ;
-use Compress::Raw::Zlib 2.011 ;
-use IO::Compress::Gzip 2.011 ;
-use IO::Uncompress::Gunzip 2.011 ;
+use IO::Compress::Base::Common 2.012 ;
+use Compress::Raw::Zlib 2.012 ;
+use IO::Compress::Gzip 2.012 ;
+use IO::Uncompress::Gunzip 2.012 ;
use strict ;
use warnings ;
use bytes ;
our ($VERSION, $XS_VERSION, @ISA, @EXPORT, $AUTOLOAD);
-$VERSION = '2.011';
+$VERSION = '2.012';
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
package Compress::Zlib ;
-use IO::Compress::Gzip::Constants 2.011 ;
+use IO::Compress::Gzip::Constants 2.012 ;
sub memGzip($)
{
my @files = getPerlFiles('MANIFEST');
+ # Note: Once you remove all the layers of shell/makefile escaping
+ # the regular expression below reads
+ #
+ # /^\s*local\s*\(\s*\$^W\s*\)/
+ #
my $postamble = '
MyTrebleCheck:
CHANGES
-------
+
+ 2.012 15 July 2008
+
+ * IO::Compress::Base
+ - Silenced an uninitialised value warning when reading a line
+ at a time from a zip file where the content uses ZIP_CM_STORE.
+ [Problem spotted & fixed by Jeff Holt]
+
+ * IO::Compress::Base & IO::Uncompress::Base
+ - local-ise $!, $? et al in the DESTROY methods.
+
2.011 17 May 2008
* IO::Compress::Base
IO-Compress-Base
- Version 2.011
+ Version 2.012
- 17th May 2008
+ 15th July 2008
Copyright (c) 2005-2008 Paul Marquess. All rights reserved.
This program is free software; you can redistribute it
If you haven't installed IO-Compress-Base then search IO::Compress::Base.pm
for a line like this:
- $VERSION = "2.011" ;
+ $VERSION = "2.012" ;
2. If you are having problems building IO-Compress-Base, send me a
complete log of what happened. Start by unpacking the IO-Compress-Base
use strict ;
use warnings;
-use IO::Compress::Base::Common 2.011 ;
+use IO::Compress::Base::Common 2.012 ;
use IO::File ;
use Scalar::Util qw(blessed readonly);
our (@ISA, $VERSION);
@ISA = qw(Exporter IO::File);
-$VERSION = '2.011';
+$VERSION = '2.012';
#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.
sub DESTROY
{
my $self = shift ;
+ local ($., $@, $!, $^E, $?);
+
$self->close() ;
# TODO - memory leak with 5.8.0 - this isn't called until
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
-
require Exporter;
our ($VERSION, @ISA, @EXPORT, %EXPORT_TAGS, $HAS_ENCODE);
@ISA = qw(Exporter);
-$VERSION = '2.011';
+$VERSION = '2.012';
@EXPORT = qw( isaFilehandle isaFilename whatIsInput whatIsOutput
isaFileGlobString cleanFileGlobString oneTarget
use warnings;
use bytes;
-use IO::Compress::Base::Common 2.011 qw(createSelfTiedObject);
+use IO::Compress::Base::Common 2.012 qw(createSelfTiedObject);
-use IO::Uncompress::Base 2.011 ;
+use IO::Uncompress::Base 2.012 ;
require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $AnyUncompressError);
-$VERSION = '2.011';
+$VERSION = '2.012';
$AnyUncompressError = '';
@ISA = qw( Exporter IO::Uncompress::Base );
BEGIN
{
- eval ' use IO::Uncompress::Adapter::Inflate 2.011 ;';
- eval ' use IO::Uncompress::Adapter::Bunzip2 2.011 ;';
- eval ' use IO::Uncompress::Adapter::LZO 2.011 ;';
- eval ' use IO::Uncompress::Adapter::Lzf 2.011 ;';
-
- eval ' use IO::Uncompress::Bunzip2 2.011 ;';
- eval ' use IO::Uncompress::UnLzop 2.011 ;';
- eval ' use IO::Uncompress::Gunzip 2.011 ;';
- eval ' use IO::Uncompress::Inflate 2.011 ;';
- eval ' use IO::Uncompress::RawInflate 2.011 ;';
- eval ' use IO::Uncompress::Unzip 2.011 ;';
- eval ' use IO::Uncompress::UnLzf 2.011 ;';
+ eval ' use IO::Uncompress::Adapter::Inflate 2.012 ;';
+ eval ' use IO::Uncompress::Adapter::Bunzip2 2.012 ;';
+ eval ' use IO::Uncompress::Adapter::LZO 2.012 ;';
+ eval ' use IO::Uncompress::Adapter::Lzf 2.012 ;';
+
+ eval ' use IO::Uncompress::Bunzip2 2.012 ;';
+ eval ' use IO::Uncompress::UnLzop 2.012 ;';
+ eval ' use IO::Uncompress::Gunzip 2.012 ;';
+ eval ' use IO::Uncompress::Inflate 2.012 ;';
+ eval ' use IO::Uncompress::RawInflate 2.012 ;';
+ eval ' use IO::Uncompress::Unzip 2.012 ;';
+ eval ' use IO::Uncompress::UnLzf 2.012 ;';
}
sub new
sub getExtraParams
{
- use IO::Compress::Base::Common 2.011 qw(:Parse);
+ use IO::Compress::Base::Common 2.012 qw(:Parse);
return ( 'RawInflate' => [1, 1, Parse_boolean, 0] ) ;
}
@ISA = qw(Exporter IO::File);
-$VERSION = '2.011';
+$VERSION = '2.012';
use constant G_EOF => 0 ;
use constant G_ERR => -1 ;
-use IO::Compress::Base::Common 2.011 ;
+use IO::Compress::Base::Common 2.012 ;
#use Parse::Parameters ;
use IO::File ;
$self->postBlockChk($buffer, $before_len) == STATUS_OK
or return G_ERR;
- $buf_len = length($$buffer) - $before_len;
+ $buf_len = defined $$buffer ? length($$buffer) - $before_len : 0;
*$self->{CompSize}->add($beforeC_len - length $temp_buf) ;
sub DESTROY
{
my $self = shift ;
+ local ($., $@, $!, $^E, $?);
+
$self->close() ;
}
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
-
my @files = getPerlFiles('MANIFEST');
+ # Note: Once you remove all the layers of shell/makefile escaping
+ # the regular expression below reads
+ #
+ # /^\s*local\s*\(\s*\$^W\s*\)/
+ #
my $postamble = '
MyTrebleCheck:
CHANGES
-------
+ 2.012 15 July 2008
+
+ * No Changes
+
2.011 17 May 2008
* IO::Uncompress::Unzip
use strict ;
require 5.004 ;
-$::VERSION = '2.011' ;
+$::VERSION = '2.012' ;
use private::MakeUtil;
use ExtUtils::MakeMaker 5.16 ;
IO-Compress-Zlib
- Version 2.011
+ Version 2.012
- 17th May 2008
+ 15th July 2008
Copyright (c) 2005-2008 Paul Marquess. All rights reserved.
This program is free software; you can redistribute it
If you haven't installed IO-Compress-Zlib then search IO::Compress::Gzip.pm
for a line like this:
- $VERSION = "2.011" ;
+ $VERSION = "2.012" ;
2. If you are having problems building IO-Compress-Zlib, send me a
complete log of what happened. Start by unpacking the IO-Compress-Zlib
use warnings;
use bytes;
-use IO::Compress::Base::Common 2.011 qw(:Status);
+use IO::Compress::Base::Common 2.012 qw(:Status);
-use Compress::Raw::Zlib 2.011 qw(Z_OK Z_FINISH MAX_WBITS) ;
+use Compress::Raw::Zlib 2.012 qw(Z_OK Z_FINISH MAX_WBITS) ;
our ($VERSION);
-$VERSION = '2.011';
+$VERSION = '2.012';
sub mkCompObject
{
use warnings;
use bytes;
-use IO::Compress::Base::Common 2.011 qw(:Status);
+use IO::Compress::Base::Common 2.012 qw(:Status);
our ($VERSION);
-$VERSION = '2.011';
+$VERSION = '2.012';
sub mkCompObject
{
require Exporter ;
-use IO::Compress::RawDeflate 2.011 ;
+use IO::Compress::RawDeflate 2.012 ;
-use Compress::Raw::Zlib 2.011 ;
-use IO::Compress::Zlib::Constants 2.011 ;
-use IO::Compress::Base::Common 2.011 qw(createSelfTiedObject);
+use Compress::Raw::Zlib 2.012 ;
+use IO::Compress::Zlib::Constants 2.012 ;
+use IO::Compress::Base::Common 2.012 qw(createSelfTiedObject);
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $DeflateError);
-$VERSION = '2.011';
+$VERSION = '2.012';
$DeflateError = '';
@ISA = qw(Exporter IO::Compress::RawDeflate);
use bytes;
-use IO::Compress::RawDeflate 2.011 ;
+use IO::Compress::RawDeflate 2.012 ;
-use Compress::Raw::Zlib 2.011 ;
-use IO::Compress::Base::Common 2.011 qw(:Status :Parse createSelfTiedObject);
-use IO::Compress::Gzip::Constants 2.011 ;
-use IO::Compress::Zlib::Extra 2.011 ;
+use Compress::Raw::Zlib 2.012 ;
+use IO::Compress::Base::Common 2.012 qw(:Status :Parse createSelfTiedObject);
+use IO::Compress::Gzip::Constants 2.012 ;
+use IO::Compress::Zlib::Extra 2.012 ;
BEGIN
{
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $GzipError);
-$VERSION = '2.011';
+$VERSION = '2.012';
$GzipError = '' ;
@ISA = qw(Exporter IO::Compress::RawDeflate);
our ($VERSION, @ISA, @EXPORT, %GZIP_OS_Names);
our ($GZIP_FNAME_INVALID_CHAR_RE, $GZIP_FCOMMENT_INVALID_CHAR_RE);
-$VERSION = '2.011';
+$VERSION = '2.012';
@ISA = qw(Exporter);
use bytes;
-use IO::Compress::Base 2.011 ;
-use IO::Compress::Base::Common 2.011 qw(:Status createSelfTiedObject);
-use IO::Compress::Adapter::Deflate 2.011 ;
+use IO::Compress::Base 2.012 ;
+use IO::Compress::Base::Common 2.012 qw(:Status createSelfTiedObject);
+use IO::Compress::Adapter::Deflate 2.012 ;
require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %DEFLATE_CONSTANTS, %EXPORT_TAGS, $RawDeflateError);
-$VERSION = '2.011';
+$VERSION = '2.012';
$RawDeflateError = '';
@ISA = qw(Exporter IO::Compress::Base);
{
my $self = shift ;
- use IO::Compress::Base::Common 2.011 qw(:Parse);
- use Compress::Raw::Zlib 2.011 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY);
+ use IO::Compress::Base::Common 2.012 qw(:Parse);
+ use Compress::Raw::Zlib 2.012 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY);
return (
use warnings;
use bytes;
-use IO::Compress::Base::Common 2.011 qw(:Status createSelfTiedObject);
-use IO::Compress::RawDeflate 2.011 ;
-use IO::Compress::Adapter::Deflate 2.011 ;
-use IO::Compress::Adapter::Identity 2.011 ;
-use IO::Compress::Zlib::Extra 2.011 ;
-use IO::Compress::Zip::Constants 2.011 ;
+use IO::Compress::Base::Common 2.012 qw(:Status createSelfTiedObject);
+use IO::Compress::RawDeflate 2.012 ;
+use IO::Compress::Adapter::Deflate 2.012 ;
+use IO::Compress::Adapter::Identity 2.012 ;
+use IO::Compress::Zlib::Extra 2.012 ;
+use IO::Compress::Zip::Constants 2.012 ;
-use Compress::Raw::Zlib 2.011 qw(crc32) ;
+use Compress::Raw::Zlib 2.012 qw(crc32) ;
BEGIN
{
eval { require IO::Compress::Adapter::Bzip2 ;
- import IO::Compress::Adapter::Bzip2 2.011 ;
+ import IO::Compress::Adapter::Bzip2 2.012 ;
require IO::Compress::Bzip2 ;
- import IO::Compress::Bzip2 2.011 ;
+ import IO::Compress::Bzip2 2.012 ;
} ;
}
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $ZipError);
-$VERSION = '2.011';
+$VERSION = '2.012';
$ZipError = '';
@ISA = qw(Exporter IO::Compress::RawDeflate);
{
my $self = shift ;
- use IO::Compress::Base::Common 2.011 qw(:Parse);
- use Compress::Raw::Zlib 2.011 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY);
+ use IO::Compress::Base::Common 2.012 qw(:Parse);
+ use Compress::Raw::Zlib 2.012 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY);
my @Bzip2 = ();
our ($VERSION, @ISA, @EXPORT, %ZIP_CM_MIN_VERSIONS);
-$VERSION = '2.011';
+$VERSION = '2.012';
@ISA = qw(Exporter);
our ($VERSION, @ISA, @EXPORT);
-$VERSION = '2.011';
+$VERSION = '2.012';
@ISA = qw(Exporter);
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS);
-$VERSION = '2.011';
+$VERSION = '2.012';
-use IO::Compress::Gzip::Constants 2.011 ;
+use IO::Compress::Gzip::Constants 2.012 ;
sub ExtraFieldError
{
use strict;
use bytes;
-use IO::Compress::Base::Common 2.011 qw(:Status);
+use IO::Compress::Base::Common 2.012 qw(:Status);
our ($VERSION);
-$VERSION = '2.011';
+$VERSION = '2.012';
-use Compress::Raw::Zlib 2.011 ();
+use Compress::Raw::Zlib 2.012 ();
sub mkUncompObject
{
use warnings;
use bytes;
-use IO::Compress::Base::Common 2.011 qw(:Status);
-use Compress::Raw::Zlib 2.011 qw(Z_OK Z_DATA_ERROR Z_STREAM_END Z_FINISH MAX_WBITS);
+use IO::Compress::Base::Common 2.012 qw(:Status);
+use Compress::Raw::Zlib 2.012 qw(Z_OK Z_DATA_ERROR Z_STREAM_END Z_FINISH MAX_WBITS);
our ($VERSION);
-$VERSION = '2.011';
+$VERSION = '2.012';
use warnings;
use bytes;
-use IO::Compress::Base::Common 2.011 qw(createSelfTiedObject);
+use IO::Compress::Base::Common 2.012 qw(createSelfTiedObject);
-use IO::Uncompress::Adapter::Inflate 2.011 ();
+use IO::Uncompress::Adapter::Inflate 2.012 ();
-use IO::Uncompress::Base 2.011 ;
-use IO::Uncompress::Gunzip 2.011 ;
-use IO::Uncompress::Inflate 2.011 ;
-use IO::Uncompress::RawInflate 2.011 ;
-use IO::Uncompress::Unzip 2.011 ;
+use IO::Uncompress::Base 2.012 ;
+use IO::Uncompress::Gunzip 2.012 ;
+use IO::Uncompress::Inflate 2.012 ;
+use IO::Uncompress::RawInflate 2.012 ;
+use IO::Uncompress::Unzip 2.012 ;
require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $AnyInflateError);
-$VERSION = '2.011';
+$VERSION = '2.012';
$AnyInflateError = '';
@ISA = qw( Exporter IO::Uncompress::Base );
sub getExtraParams
{
- use IO::Compress::Base::Common 2.011 qw(:Parse);
+ use IO::Compress::Base::Common 2.012 qw(:Parse);
return ( 'RawInflate' => [1, 1, Parse_boolean, 0] ) ;
}
use warnings;
use bytes;
-use IO::Uncompress::RawInflate 2.011 ;
+use IO::Uncompress::RawInflate 2.012 ;
-use Compress::Raw::Zlib 2.011 qw( crc32 ) ;
-use IO::Compress::Base::Common 2.011 qw(:Status createSelfTiedObject);
-use IO::Compress::Gzip::Constants 2.011 ;
-use IO::Compress::Zlib::Extra 2.011 ;
+use Compress::Raw::Zlib 2.012 qw( crc32 ) ;
+use IO::Compress::Base::Common 2.012 qw(:Status createSelfTiedObject);
+use IO::Compress::Gzip::Constants 2.012 ;
+use IO::Compress::Zlib::Extra 2.012 ;
require Exporter ;
$GunzipError = '';
-$VERSION = '2.011';
+$VERSION = '2.012';
sub new
{
sub getExtraParams
{
- use IO::Compress::Base::Common 2.011 qw(:Parse);
+ use IO::Compress::Base::Common 2.012 qw(:Parse);
return ( 'ParseExtra' => [1, 1, Parse_boolean, 0] ) ;
}
use warnings;
use bytes;
-use IO::Compress::Base::Common 2.011 qw(:Status createSelfTiedObject);
-use IO::Compress::Zlib::Constants 2.011 ;
+use IO::Compress::Base::Common 2.012 qw(:Status createSelfTiedObject);
+use IO::Compress::Zlib::Constants 2.012 ;
-use IO::Uncompress::RawInflate 2.011 ;
+use IO::Uncompress::RawInflate 2.012 ;
require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $InflateError);
-$VERSION = '2.011';
+$VERSION = '2.012';
$InflateError = '';
@ISA = qw( Exporter IO::Uncompress::RawInflate );
use warnings;
use bytes;
-use Compress::Raw::Zlib 2.011 ;
-use IO::Compress::Base::Common 2.011 qw(:Status createSelfTiedObject);
+use Compress::Raw::Zlib 2.012 ;
+use IO::Compress::Base::Common 2.012 qw(:Status createSelfTiedObject);
-use IO::Uncompress::Base 2.011 ;
-use IO::Uncompress::Adapter::Inflate 2.011 ;
+use IO::Uncompress::Base 2.012 ;
+use IO::Uncompress::Adapter::Inflate 2.012 ;
require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $RawInflateError);
-$VERSION = '2.011';
+$VERSION = '2.012';
$RawInflateError = '';
@ISA = qw( Exporter IO::Uncompress::Base );
use warnings;
use bytes;
-use IO::Uncompress::RawInflate 2.011 ;
-use IO::Compress::Base::Common 2.011 qw(:Status createSelfTiedObject);
-use IO::Uncompress::Adapter::Inflate 2.011 ;
-use IO::Uncompress::Adapter::Identity 2.011 ;
-use IO::Compress::Zlib::Extra 2.011 ;
-use IO::Compress::Zip::Constants 2.011 ;
+use IO::Uncompress::RawInflate 2.012 ;
+use IO::Compress::Base::Common 2.012 qw(:Status createSelfTiedObject);
+use IO::Uncompress::Adapter::Inflate 2.012 ;
+use IO::Uncompress::Adapter::Identity 2.012 ;
+use IO::Compress::Zlib::Extra 2.012 ;
+use IO::Compress::Zip::Constants 2.012 ;
-use Compress::Raw::Zlib 2.011 qw(crc32) ;
+use Compress::Raw::Zlib 2.012 qw(crc32) ;
BEGIN
{
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $UnzipError, %headerLookup);
-$VERSION = '2.011';
+$VERSION = '2.012';
$UnzipError = '';
@ISA = qw(Exporter IO::Uncompress::RawInflate);
sub getExtraParams
{
- use IO::Compress::Base::Common 2.011 qw(:Parse);
+ use IO::Compress::Base::Common 2.012 qw(:Parse);
return (
my @files = getPerlFiles('MANIFEST');
+ # Note: Once you remove all the layers of shell/makefile escaping
+ # the regular expression below reads
+ #
+ # /^\s*local\s*\(\s*\$^W\s*\)/
+ #
my $postamble = '
MyTrebleCheck:
$extra = 1
if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 };
- plan tests => 62 + $extra ;
+ plan tests => 77 + $extra ;
use_ok('IO::Compress::Zip', qw(:all)) ;
use_ok('IO::Uncompress::Unzip', qw(unzip $UnzipError)) ;
is $got[2], $content[2], "Got 3nd entry";
}
+
+SKIP:
+for my $method (ZIP_CM_DEFLATE, ZIP_CM_STORE, ZIP_CM_BZIP2)
+{
+ title "Read a line from zip, Method $method";
+
+ skip "IO::Compress::Bzip2 not available", 14
+ unless defined $IO::Compress::Bzip2::VERSION;
+
+ my $content = "a single line\n";
+ my $zip ;
+
+ my $status = zip \$content => \$zip,
+ Method => $method,
+ Stream => 0,
+ Name => "123";
+ is $status, 1, " Created a zip file";
+
+ my $u = new IO::Uncompress::Unzip \$zip;
+ isa_ok $u, "IO::Uncompress::Unzip";
+
+ is $u->getline, $content, " Read first line ok";
+ ok ! $u->getline, " Second line doesn't exist";
+
+
+}
$extra = 1
if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 };
- plan tests => 7 + $extra ;
+ plan tests => 15 + $extra ;
use_ok('IO::File') ;
}
ok anyUncompress($name) eq $hello ;
}
+
+ {
+ title "Testing DESTROY doesn't clobber \$! etc ";
+
+ my $lex = new LexFile my $name ;
+
+ my $out;
+ my $result;
+
+ {
+ ok my $z = new $CompressClass($name);
+ $z->write("abc") ;
+ $! = 22 ;
+
+ cmp_ok $!, '==', 22, ' $! is 22';
+ }
+
+ cmp_ok $!, '==', 22, " \$! has not been changed by $CompressClass destructor";
+
+
+ {
+ my $uncomp;
+ ok my $x = new $UncompressClass($name, -Append => 1) ;
+
+ my $len ;
+ 1 while ($len = $x->read($result)) > 0 ;
+
+ $! = 22 ;
+
+ cmp_ok $!, '==', 22, ' $! is 22';
+ }
+
+ cmp_ok $!, '==', 22, " \$! has not been changed by $UncompressClass destructor";
+
+ is $result, "abc", " Got uncompressed content ok";
+
+ }
}
1;
}
+
{
title "Testing $CompressClass and $UncompressClass";