ext/IO_Compress_Zlib/t/002any-zip.t IO::Compress::Zlib
ext/IO_Compress_Zlib/t/004gziphdr.t IO::Compress::Zlib
ext/IO_Compress_Zlib/t/005defhdr.t IO::Compress::Zlib
+ext/IO_Compress_Zlib/t/006zip.t IO::Compress::Zlib
ext/IO_Compress_Zlib/t/010examples.t IO::Compress::Zlib
ext/IO_Compress_Zlib/t/020isize.t IO::Compress::Zlib
ext/IO_Compress_Zlib/t/050interop-gzip.t IO::Compress::Zlib
CHANGES
-------
+ 2.011 5 May 2008
+
+ * A C++-style comment sneaked in with the last update. Fixed.
+ [core patch #33828]
+
2.010 5 May 2008
* No Changes
Compress-Raw-Zlib
- Version 2.010
+ Version 2.011
- 5th May 2008
+ 17th May 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.010" ;
+ $VERSION = "2.011" ;
c. The version of zlib you have used.
If you have successfully installed Compress-Raw-Zlib, this one-liner
use bytes ;
our ($VERSION, $XS_VERSION, @ISA, @EXPORT, $AUTOLOAD);
-$VERSION = '2.010';
+$VERSION = '2.011';
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
CHANGES
-------
+ 2.011 17 May 2008
+
+ * No Changes
+
2.010 5 May 2008
* Fixed problem that meant Perl 5.10 could not upgrade this module.
use strict ;
require 5.004 ;
-$::VERSION = '2.010' ;
+$::VERSION = '2.011' ;
use private::MakeUtil;
use ExtUtils::MakeMaker 5.16 ;
Compress-Zlib
- Version 2.010
+ Version 2.011
- 5th May 2008
+ 17th May 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.010" ;
+ $VERSION = "2.011" ;
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.010 ;
-use Compress::Raw::Zlib 2.010 ;
-use IO::Compress::Gzip 2.010 ;
-use IO::Uncompress::Gunzip 2.010 ;
+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 strict ;
use warnings ;
use bytes ;
our ($VERSION, $XS_VERSION, @ISA, @EXPORT, $AUTOLOAD);
-$VERSION = '2.010';
+$VERSION = '2.011';
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
package Compress::Zlib ;
-use IO::Compress::Gzip::Constants 2.010 ;
+use IO::Compress::Gzip::Constants 2.011 ;
sub memGzip($)
{
CHANGES
-------
+ 2.011 17 May 2008
+
+ * IO::Compress::Base
+ - Fixed problem that prevented the creation of a zip file that
+ contained more than one compression method.
+
+ * IO::Compress::Base::Common
+ - The private Validator class in this module clashes with another
+ CPAN module. Moved Validator into the IO::Compress::Base::Common
+ namespace.
+ [RT #35954]
+
2.010 5 May 2008
* Fixed problem that meant Perl 5.10 could not upgrade this module.
IO-Compress-Base
- Version 2.010
+ Version 2.011
- 5th May 2008
+ 17th May 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.010" ;
+ $VERSION = "2.011" ;
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.010 ;
+use IO::Compress::Base::Common 2.011 ;
use IO::File ;
use Scalar::Util qw(blessed readonly);
our (@ISA, $VERSION);
@ISA = qw(Exporter IO::File);
-$VERSION = '2.010';
+$VERSION = '2.011';
#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.
my $status ;
if (! $merge)
{
- *$obj->{Compress} = $obj->mkComp($class, $got)
+ *$obj->{Compress} = $obj->mkComp($got)
or return undef;
*$obj->{UnCompSize} = new U64 ;
my $haveOut = @_ ;
my $output = shift ;
- my $x = new Validator($class, *$obj->{Error}, $name, $input, $output)
+ my $x = new IO::Compress::Base::Validator($class, *$obj->{Error}, $name, $input, $output)
or return undef ;
push @_, $output if $haveOut && $x->{Hash};
$self->ckParams($got)
or $self->croakError("newStream: $self->{Error}");
+ *$self->{Compress} = $self->mkComp($got)
+ or return 0;
+
*$self->{Header} = $self->mkHeader($got) ;
$self->output(*$self->{Header} )
or return 0;
- my $status = $self->reset() ;
- return $self->saveErrorString(0, *$self->{Compress}{Error},
- *$self->{Compress}{ErrorNo})
- if $status == STATUS_ERROR;
-
*$self->{UnCompSize}->reset();
*$self->{CompSize}->reset();
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.010';
+$VERSION = '2.011';
@EXPORT = qw( isaFilehandle isaFilename whatIsInput whatIsOutput
isaFileGlobString cleanFileGlobString oneTarget
return $_[0] =~ /^(code|handle|buffer|filename)$/;
}
-sub Validator::new
+sub IO::Compress::Base::Validator::new
{
my $class = shift ;
return $obj ;
}
-sub Validator::saveErrorString
+sub IO::Compress::Base::Validator::saveErrorString
{
my $self = shift ;
${ $self->{Error} } = shift ;
}
-sub Validator::croakError
+sub IO::Compress::Base::Validator::croakError
{
my $self = shift ;
$self->saveErrorString($_[0]);
-sub Validator::validateInputFilenames
+sub IO::Compress::Base::Validator::validateInputFilenames
{
my $self = shift ;
return 1 ;
}
-sub Validator::validateInputArray
+sub IO::Compress::Base::Validator::validateInputArray
{
my $self = shift ;
return 1 ;
}
-#sub Validator::validateHash
+#sub IO::Compress::Base::Validator::validateHash
#{
# my $self = shift ;
# my $href = shift ;
use warnings;
use bytes;
-use IO::Compress::Base::Common 2.010 qw(createSelfTiedObject);
+use IO::Compress::Base::Common 2.011 qw(createSelfTiedObject);
-use IO::Uncompress::Base 2.010 ;
+use IO::Uncompress::Base 2.011 ;
require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $AnyUncompressError);
-$VERSION = '2.010';
+$VERSION = '2.011';
$AnyUncompressError = '';
@ISA = qw( Exporter IO::Uncompress::Base );
BEGIN
{
- eval ' use IO::Uncompress::Adapter::Inflate 2.010 ;';
- eval ' use IO::Uncompress::Adapter::Bunzip2 2.010 ;';
- eval ' use IO::Uncompress::Adapter::LZO 2.010 ;';
- eval ' use IO::Uncompress::Adapter::Lzf 2.010 ;';
-
- eval ' use IO::Uncompress::Bunzip2 2.010 ;';
- eval ' use IO::Uncompress::UnLzop 2.010 ;';
- eval ' use IO::Uncompress::Gunzip 2.010 ;';
- eval ' use IO::Uncompress::Inflate 2.010 ;';
- eval ' use IO::Uncompress::RawInflate 2.010 ;';
- eval ' use IO::Uncompress::Unzip 2.010 ;';
- eval ' use IO::Uncompress::UnLzf 2.010 ;';
+ 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 ;';
}
sub new
sub getExtraParams
{
- use IO::Compress::Base::Common 2.010 qw(:Parse);
+ use IO::Compress::Base::Common 2.011 qw(:Parse);
return ( 'RawInflate' => [1, 1, Parse_boolean, 0] ) ;
}
sub mkUncomp
{
my $self = shift ;
- my $class = shift ;
my $got = shift ;
my $magic ;
@ISA = qw(Exporter IO::File);
-$VERSION = '2.010';
+$VERSION = '2.011';
use constant G_EOF => 0 ;
use constant G_ERR => -1 ;
-use IO::Compress::Base::Common 2.010 ;
+use IO::Compress::Base::Common 2.011 ;
#use Parse::Parameters ;
use IO::File ;
return $obj
}
- my $status = $obj->mkUncomp($class, $got);
+ my $status = $obj->mkUncomp($got);
return undef
unless defined $status;
my $output = shift ;
- my $x = new Validator($class, *$obj->{Error}, $name, $input, $output)
+ my $x = new IO::Compress::Base::Validator($class, *$obj->{Error}, $name, $input, $output)
or return undef ;
push @_, $output if $haveOut && $x->{Hash};
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
+
CHANGES
-------
+ 2.011 17 May 2008
+
+ * IO::Uncompress::Unzip
+ - Print an error message if the zip file contains a
+ member compressed with bzip2 and IO::Uncompress::Bunzip2 is
+ not available.
+ - Could not cope with mixed compression zip files. For example a
+ zip file that contains both STORED and DEFLATED content.
+ [RT #35573]
+
2.010 5 May 2008
* Fixed problem that meant Perl 5.10 could not upgrade this module.
use strict ;
require 5.004 ;
-$::VERSION = '2.010' ;
+$::VERSION = '2.011' ;
use private::MakeUtil;
use ExtUtils::MakeMaker 5.16 ;
IO-Compress-Zlib
- Version 2.010
+ Version 2.011
- 5th May 2008
+ 17th May 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.010" ;
+ $VERSION = "2.011" ;
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.010 qw(:Status);
+use IO::Compress::Base::Common 2.011 qw(:Status);
-use Compress::Raw::Zlib 2.010 qw(Z_OK Z_FINISH MAX_WBITS) ;
+use Compress::Raw::Zlib 2.011 qw(Z_OK Z_FINISH MAX_WBITS) ;
our ($VERSION);
-$VERSION = '2.010';
+$VERSION = '2.011';
sub mkCompObject
{
use warnings;
use bytes;
-use IO::Compress::Base::Common 2.010 qw(:Status);
+use IO::Compress::Base::Common 2.011 qw(:Status);
our ($VERSION);
-$VERSION = '2.010';
+$VERSION = '2.011';
sub mkCompObject
{
require Exporter ;
-use IO::Compress::RawDeflate 2.010 ;
+use IO::Compress::RawDeflate 2.011 ;
-use Compress::Raw::Zlib 2.010 ;
-use IO::Compress::Zlib::Constants 2.010 ;
-use IO::Compress::Base::Common 2.010 qw(createSelfTiedObject);
+use Compress::Raw::Zlib 2.011 ;
+use IO::Compress::Zlib::Constants 2.011 ;
+use IO::Compress::Base::Common 2.011 qw(createSelfTiedObject);
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $DeflateError);
-$VERSION = '2.010';
+$VERSION = '2.011';
$DeflateError = '';
@ISA = qw(Exporter IO::Compress::RawDeflate);
use bytes;
-use IO::Compress::RawDeflate 2.010 ;
+use IO::Compress::RawDeflate 2.011 ;
-use Compress::Raw::Zlib 2.010 ;
-use IO::Compress::Base::Common 2.010 qw(:Status :Parse createSelfTiedObject);
-use IO::Compress::Gzip::Constants 2.010 ;
-use IO::Compress::Zlib::Extra 2.010 ;
+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 ;
BEGIN
{
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $GzipError);
-$VERSION = '2.010';
+$VERSION = '2.011';
$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.010';
+$VERSION = '2.011';
@ISA = qw(Exporter);
use bytes;
-use IO::Compress::Base 2.010 ;
-use IO::Compress::Base::Common 2.010 qw(:Status createSelfTiedObject);
-use IO::Compress::Adapter::Deflate 2.010 ;
+use IO::Compress::Base 2.011 ;
+use IO::Compress::Base::Common 2.011 qw(:Status createSelfTiedObject);
+use IO::Compress::Adapter::Deflate 2.011 ;
require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %DEFLATE_CONSTANTS, %EXPORT_TAGS, $RawDeflateError);
-$VERSION = '2.010';
+$VERSION = '2.011';
$RawDeflateError = '';
@ISA = qw(Exporter IO::Compress::Base);
sub mkComp
{
my $self = shift ;
- my $class = shift ;
my $got = shift ;
my ($obj, $errstr, $errno) = IO::Compress::Adapter::Deflate::mkCompObject(
{
my $self = shift ;
- use IO::Compress::Base::Common 2.010 qw(:Parse);
- use Compress::Raw::Zlib 2.010 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY);
+ use IO::Compress::Base::Common 2.011 qw(:Parse);
+ use Compress::Raw::Zlib 2.011 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY);
return (
use warnings;
use bytes;
-use IO::Compress::Base::Common 2.010 qw(:Status createSelfTiedObject);
-use IO::Compress::RawDeflate 2.010 ;
-use IO::Compress::Adapter::Deflate 2.010 ;
-use IO::Compress::Adapter::Identity 2.010 ;
-use IO::Compress::Zlib::Extra 2.010 ;
-use IO::Compress::Zip::Constants 2.010 ;
+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 Compress::Raw::Zlib 2.010 qw(crc32) ;
+use Compress::Raw::Zlib 2.011 qw(crc32) ;
BEGIN
{
eval { require IO::Compress::Adapter::Bzip2 ;
- import IO::Compress::Adapter::Bzip2 2.010 ;
+ import IO::Compress::Adapter::Bzip2 2.011 ;
require IO::Compress::Bzip2 ;
- import IO::Compress::Bzip2 2.010 ;
+ import IO::Compress::Bzip2 2.011 ;
} ;
}
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $ZipError);
-$VERSION = '2.010';
+$VERSION = '2.011';
$ZipError = '';
@ISA = qw(Exporter IO::Compress::RawDeflate);
sub mkComp
{
my $self = shift ;
- my $class = shift ;
my $got = shift ;
my ($obj, $errstr, $errno) ;
{
my $self = shift ;
- use IO::Compress::Base::Common 2.010 qw(:Parse);
- use Compress::Raw::Zlib 2.010 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY);
+ use IO::Compress::Base::Common 2.011 qw(:Parse);
+ use Compress::Raw::Zlib 2.011 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY);
my @Bzip2 = ();
our ($VERSION, @ISA, @EXPORT, %ZIP_CM_MIN_VERSIONS);
-$VERSION = '2.010';
+$VERSION = '2.011';
@ISA = qw(Exporter);
ZIP_GP_FLAG_PATCHED_MASK
ZIP_GP_FLAG_STRONG_ENCRYPTED_MASK
ZIP_GP_FLAG_LZMA_EOS_PRESENT
+ ZIP_GP_FLAG_LANGUAGE_ENCODING
ZIP_EXTRA_ID_ZIP64
ZIP_EXTRA_ID_EXT_TIMESTAMP
use constant ZIP_EXTRA_ID_ZIP64 => pack "v", 1;
use constant ZIP_EXTRA_ID_EXT_TIMESTAMP => "UT";
use constant ZIP_EXTRA_ID_INFO_ZIP_UNIX2 => "Ux";
+use constant ZIP_EXTRA_ID_JAVA_EXE => pack "v", 0xCAFE;
use constant ZIP64_MIN_VERSION => 45;
our ($VERSION, @ISA, @EXPORT);
-$VERSION = '2.010';
+$VERSION = '2.011';
@ISA = qw(Exporter);
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS);
-$VERSION = '2.010';
+$VERSION = '2.011';
-use IO::Compress::Gzip::Constants 2.010 ;
+use IO::Compress::Gzip::Constants 2.011 ;
sub ExtraFieldError
{
use strict;
use bytes;
-use IO::Compress::Base::Common 2.010 qw(:Status);
+use IO::Compress::Base::Common 2.011 qw(:Status);
our ($VERSION);
-$VERSION = '2.010';
+$VERSION = '2.011';
-use Compress::Raw::Zlib 2.010 ();
+use Compress::Raw::Zlib 2.011 ();
sub mkUncompObject
{
use warnings;
use bytes;
-use IO::Compress::Base::Common 2.010 qw(:Status);
-use Compress::Raw::Zlib 2.010 qw(Z_OK Z_DATA_ERROR Z_STREAM_END Z_FINISH MAX_WBITS);
+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);
our ($VERSION);
-$VERSION = '2.010';
+$VERSION = '2.011';
use warnings;
use bytes;
-use IO::Compress::Base::Common 2.010 qw(createSelfTiedObject);
+use IO::Compress::Base::Common 2.011 qw(createSelfTiedObject);
-use IO::Uncompress::Adapter::Inflate 2.010 ();
+use IO::Uncompress::Adapter::Inflate 2.011 ();
-use IO::Uncompress::Base 2.010 ;
-use IO::Uncompress::Gunzip 2.010 ;
-use IO::Uncompress::Inflate 2.010 ;
-use IO::Uncompress::RawInflate 2.010 ;
-use IO::Uncompress::Unzip 2.010 ;
+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 ;
require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $AnyInflateError);
-$VERSION = '2.010';
+$VERSION = '2.011';
$AnyInflateError = '';
@ISA = qw( Exporter IO::Uncompress::Base );
sub getExtraParams
{
- use IO::Compress::Base::Common 2.010 qw(:Parse);
+ use IO::Compress::Base::Common 2.011 qw(:Parse);
return ( 'RawInflate' => [1, 1, Parse_boolean, 0] ) ;
}
sub mkUncomp
{
my $self = shift ;
- my $class = shift ;
my $got = shift ;
my ($obj, $errstr, $errno) = IO::Uncompress::Adapter::Inflate::mkUncompObject();
use warnings;
use bytes;
-use IO::Uncompress::RawInflate 2.010 ;
+use IO::Uncompress::RawInflate 2.011 ;
-use Compress::Raw::Zlib 2.010 qw( crc32 ) ;
-use IO::Compress::Base::Common 2.010 qw(:Status createSelfTiedObject);
-use IO::Compress::Gzip::Constants 2.010 ;
-use IO::Compress::Zlib::Extra 2.010 ;
+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 ;
require Exporter ;
$GunzipError = '';
-$VERSION = '2.010';
+$VERSION = '2.011';
sub new
{
sub getExtraParams
{
- use IO::Compress::Base::Common 2.010 qw(:Parse);
+ use IO::Compress::Base::Common 2.011 qw(:Parse);
return ( 'ParseExtra' => [1, 1, Parse_boolean, 0] ) ;
}
use warnings;
use bytes;
-use IO::Compress::Base::Common 2.010 qw(:Status createSelfTiedObject);
-use IO::Compress::Zlib::Constants 2.010 ;
+use IO::Compress::Base::Common 2.011 qw(:Status createSelfTiedObject);
+use IO::Compress::Zlib::Constants 2.011 ;
-use IO::Uncompress::RawInflate 2.010 ;
+use IO::Uncompress::RawInflate 2.011 ;
require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $InflateError);
-$VERSION = '2.010';
+$VERSION = '2.011';
$InflateError = '';
@ISA = qw( Exporter IO::Uncompress::RawInflate );
use warnings;
use bytes;
-use Compress::Raw::Zlib 2.010 ;
-use IO::Compress::Base::Common 2.010 qw(:Status createSelfTiedObject);
+use Compress::Raw::Zlib 2.011 ;
+use IO::Compress::Base::Common 2.011 qw(:Status createSelfTiedObject);
-use IO::Uncompress::Base 2.010 ;
-use IO::Uncompress::Adapter::Inflate 2.010 ;
+use IO::Uncompress::Base 2.011 ;
+use IO::Uncompress::Adapter::Inflate 2.011 ;
require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $RawInflateError);
-$VERSION = '2.010';
+$VERSION = '2.011';
$RawInflateError = '';
@ISA = qw( Exporter IO::Uncompress::Base );
sub mkUncomp
{
my $self = shift ;
- my $class = shift ;
my $got = shift ;
my ($obj, $errstr, $errno) = IO::Uncompress::Adapter::Inflate::mkUncompObject(
use warnings;
use bytes;
-use IO::Uncompress::RawInflate 2.010 ;
-use IO::Compress::Base::Common 2.010 qw(:Status createSelfTiedObject);
-use IO::Uncompress::Adapter::Identity 2.010 ;
-use IO::Compress::Zlib::Extra 2.010 ;
-use IO::Compress::Zip::Constants 2.010 ;
+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 Compress::Raw::Zlib 2.010 qw(crc32) ;
+use Compress::Raw::Zlib 2.011 qw(crc32) ;
BEGIN
{
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $UnzipError, %headerLookup);
-$VERSION = '2.010';
+$VERSION = '2.011';
$UnzipError = '';
@ISA = qw(Exporter IO::Uncompress::RawInflate);
sub getExtraParams
{
- use IO::Compress::Base::Common 2.010 qw(:Parse);
+ use IO::Compress::Base::Common 2.011 qw(:Parse);
return (
return 1;
}
+sub mkUncomp
+{
+ my $self = shift ;
+ my $got = shift ;
+
+ my $magic = $self->ckMagic()
+ or return 0;
+
+ *$self->{Info} = $self->readHeader($magic)
+ or return undef ;
+
+ return 1;
+
+}
sub ckMagic
{
if ($compressedMethod == ZIP_CM_DEFLATE)
{
*$self->{Type} = 'zip-deflate';
+ my $obj = IO::Uncompress::Adapter::Inflate::mkUncompObject(1,0,0);
+
+ *$self->{Uncomp} = $obj;
+ *$self->{ZipData}{CRC32} = crc32(undef);
}
elsif ($compressedMethod == ZIP_CM_BZIP2)
{
- #if (! defined $IO::Uncompress::Adapter::Bunzip2::VERSION)
+ return $self->HeaderError("Unsupported Compression format $compressedMethod")
+ if ! defined $IO::Uncompress::Adapter::Bunzip2::VERSION ;
*$self->{Type} = 'zip-bzip2';
- my $obj = IO::Uncompress::Adapter::Bunzip2::mkUncompObject(
- );
+ my $obj = IO::Uncompress::Adapter::Bunzip2::mkUncompObject();
*$self->{Uncomp} = $obj;
*$self->{ZipData}{CRC32} = crc32(undef);
-
}
elsif ($compressedMethod == ZIP_CM_STORE)
{
*$self->{Type} = 'zip-stored';
- my $obj = IO::Uncompress::Adapter::Identity::mkUncompObject(# $got->value('CRC32'),
- # $got->value('ADLER32'),
- );
+ my $obj = IO::Uncompress::Adapter::Identity::mkUncompObject();
*$self->{Uncomp} = $obj;
-
}
else
{
my $zipfile = "somefile.zip";
my $u = new IO::Uncompress::Unzip $zipfile
- or die "Cannot open $filefile: $UnzipError";
+ or die "Cannot open $zipfile: $UnzipError";
- for (my $status = 1; ! $u->eof(); $status = $u->nextStream())
+ my $status;
+ for ($status = 1; ! $u->eof(); $status = $u->nextStream())
+ {
my $name = $u->getHeaderInfo()->{Name};
warn "Processing member $name\n" ;
--- /dev/null
+BEGIN {
+ if ($ENV{PERL_CORE}) {
+ chdir 't' if -d 't';
+ @INC = ("../lib", "lib/compress");
+ }
+}
+
+use lib qw(t t/compress);
+use strict;
+use warnings;
+use bytes;
+
+use Test::More ;
+use CompTestUtils;
+
+BEGIN {
+ # use Test::NoWarnings, if available
+ my $extra = 0 ;
+ $extra = 1
+ if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 };
+
+ plan tests => 62 + $extra ;
+
+ use_ok('IO::Compress::Zip', qw(:all)) ;
+ use_ok('IO::Uncompress::Unzip', qw(unzip $UnzipError)) ;
+
+ eval {
+ require IO::Compress::Bzip2 ;
+ import IO::Compress::Bzip2 2.010 ;
+ require IO::Uncompress::Bunzip2 ;
+ import IO::Uncompress::Bunzip2 2.010 ;
+ } ;
+
+}
+
+
+sub getContent
+{
+ my $filename = shift;
+
+ my $u = new IO::Uncompress::Unzip $filename, Append => 1
+ or die "Cannot open $filename: $UnzipError";
+
+ isa_ok $u, "IO::Uncompress::Unzip";
+
+ my @content;
+ my $status ;
+
+ for ($status = 1; ! $u->eof(); $status = $u->nextStream())
+ {
+
+ my $name = $u->getHeaderInfo()->{Name};
+ #warn "Processing member $name\n" ;
+
+ my $buff = '';
+ 1 while ($status = $u->read($buff)) > 0;
+
+ push @content, $buff;
+ last unless $status == 0;
+ }
+
+ die "Error processing $filename: $status $!\n"
+ if $status < 0 ;
+
+ return @content;
+}
+
+
+{
+ title "Create a simple zip - All Deflate";
+
+ my $lex = new LexFile my $file1;
+
+ my @content = (
+ 'hello',
+ '',
+ 'goodbye ',
+ );
+
+ my $zip = new IO::Compress::Zip $file1,
+ Name => "one", Method => ZIP_CM_DEFLATE, Stream => 0;
+ isa_ok $zip, "IO::Compress::Zip";
+
+ is $zip->write($content[0]), length($content[0]), "write";
+ $zip->newStream(Name=> "two", Method => ZIP_CM_DEFLATE);
+ is $zip->write($content[1]), length($content[1]), "write";
+ $zip->newStream(Name=> "three", Method => ZIP_CM_DEFLATE);
+ is $zip->write($content[2]), length($content[2]), "write";
+ ok $zip->close(), "closed";
+
+ my @got = getContent($file1);
+
+ is $got[0], $content[0], "Got 1st entry";
+ is $got[1], $content[1], "Got 2nd entry";
+ is $got[2], $content[2], "Got 3nd entry";
+}
+
+SKIP:
+{
+ title "Create a simple zip - All Bzip2";
+
+ skip "IO::Compress::Bzip2 not available", 9
+ unless defined $IO::Compress::Bzip2::VERSION;
+
+ my $lex = new LexFile my $file1;
+
+ my @content = (
+ 'hello',
+ '',
+ 'goodbye ',
+ );
+
+ my $zip = new IO::Compress::Zip $file1,
+ Name => "one", Method => ZIP_CM_BZIP2, Stream => 0;
+ isa_ok $zip, "IO::Compress::Zip";
+
+ is $zip->write($content[0]), length($content[0]), "write";
+ $zip->newStream(Name=> "two", Method => ZIP_CM_BZIP2);
+ is $zip->write($content[1]), length($content[1]), "write";
+ $zip->newStream(Name=> "three", Method => ZIP_CM_BZIP2);
+ is $zip->write($content[2]), length($content[2]), "write";
+ ok $zip->close(), "closed";
+
+ my @got = getContent($file1);
+
+ is $got[0], $content[0], "Got 1st entry";
+ is $got[1], $content[1], "Got 2nd entry";
+ is $got[2], $content[2], "Got 3nd entry";
+}
+
+SKIP:
+{
+ title "Create a simple zip - Deflate + Bzip2";
+
+ skip "IO::Compress::Bzip2 not available", 9
+ unless $IO::Compress::Bzip2::VERSION;
+
+ my $lex = new LexFile my $file1;
+
+ my @content = (
+ 'hello',
+ 'and',
+ 'goodbye ',
+ );
+
+ my $zip = new IO::Compress::Zip $file1,
+ Name => "one", Method => ZIP_CM_DEFLATE, Stream => 0;
+ isa_ok $zip, "IO::Compress::Zip";
+
+ is $zip->write($content[0]), length($content[0]), "write";
+ $zip->newStream(Name=> "two", Method => ZIP_CM_BZIP2);
+ is $zip->write($content[1]), length($content[1]), "write";
+ $zip->newStream(Name=> "three", Method => ZIP_CM_DEFLATE);
+ is $zip->write($content[2]), length($content[2]), "write";
+ ok $zip->close(), "closed";
+
+ my @got = getContent($file1);
+
+ is $got[0], $content[0], "Got 1st entry";
+ is $got[1], $content[1], "Got 2nd entry";
+ is $got[2], $content[2], "Got 3nd entry";
+}
+
+{
+ title "Create a simple zip - All STORE";
+
+ my $lex = new LexFile my $file1;
+
+ my @content = (
+ 'hello',
+ '',
+ 'goodbye ',
+ );
+
+ my $zip = new IO::Compress::Zip $file1,
+ Name => "one", Method => ZIP_CM_STORE, Stream => 0;
+ isa_ok $zip, "IO::Compress::Zip";
+
+ is $zip->write($content[0]), length($content[0]), "write";
+ $zip->newStream(Name=> "two", Method => ZIP_CM_STORE);
+ is $zip->write($content[1]), length($content[1]), "write";
+ $zip->newStream(Name=> "three", Method => ZIP_CM_STORE);
+ is $zip->write($content[2]), length($content[2]), "write";
+ ok $zip->close(), "closed";
+
+ my @got = getContent($file1);
+
+ is $got[0], $content[0], "Got 1st entry";
+ is $got[1], $content[1], "Got 2nd entry";
+ is $got[2], $content[2], "Got 3nd entry";
+}
+
+{
+ title "Create a simple zip - Deflate + STORE";
+
+ #my $lex = new LexFile my $file1;
+ my $file1 = "tryout.zip";
+
+ my @content = qw(
+ hello
+ and
+ goodbye
+ );
+
+ my $zip = new IO::Compress::Zip $file1,
+ Name => "one", Method => ZIP_CM_DEFLATE, Stream => 0;
+ isa_ok $zip, "IO::Compress::Zip";
+
+ is $zip->write($content[0]), length($content[0]), "write";
+ $zip->newStream(Name=> "two", Method => ZIP_CM_STORE);
+ is $zip->write($content[1]), length($content[1]), "write";
+ $zip->newStream(Name=> "three", Method => ZIP_CM_DEFLATE);
+ is $zip->write($content[2]), length($content[2]), "write";
+ ok $zip->close(), "closed";
+
+ my @got = getContent($file1);
+
+ is $got[0], $content[0], "Got 1st entry";
+ is $got[1], $content[1], "Got 2nd entry";
+ is $got[2], $content[2], "Got 3nd entry";
+}
+
+{
+ title "Create a simple zip - Deflate + zero length STORE";
+
+ my $lex = new LexFile my $file1;
+
+ my @content = (
+ 'hello ',
+ '',
+ 'goodbye ',
+ );
+
+ my $zip = new IO::Compress::Zip $file1,
+ Name => "one", Method => ZIP_CM_DEFLATE, Stream => 0;
+ isa_ok $zip, "IO::Compress::Zip";
+
+ is $zip->write($content[0]), length($content[0]), "write";
+ $zip->newStream(Name=> "two", Method => ZIP_CM_STORE);
+ is $zip->write($content[1]), length($content[1]), "write";
+ $zip->newStream(Name=> "three", Method => ZIP_CM_DEFLATE);
+ is $zip->write($content[2]), length($content[2]), "write";
+ ok $zip->close(), "closed";
+
+ my @got = getContent($file1);
+
+ is $got[0], $content[0], "Got 1st entry";
+ ok $got[1] eq $content[1], "Got 2nd entry";
+ is $got[2], $content[2], "Got 3nd entry";
+}
+