This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade to IO-Compress-Base-2.004, Compress-Raw-Zlib-2.004,
authorSteve Peters <steve@fisharerojo.org>
Sun, 4 Mar 2007 07:01:34 +0000 (07:01 +0000)
committerSteve Peters <steve@fisharerojo.org>
Sun, 4 Mar 2007 07:01:34 +0000 (07:01 +0000)
IO-Compress-Zlib-2.004, and Compress-Zlib-2.004.

p4raw-id: //depot/perl@30458

41 files changed:
ext/Compress/Raw/Zlib/Changes
ext/Compress/Raw/Zlib/Makefile.PL
ext/Compress/Raw/Zlib/README
ext/Compress/Raw/Zlib/Zlib.xs
ext/Compress/Raw/Zlib/lib/Compress/Raw/Zlib.pm
ext/Compress/Raw/Zlib/t/02zlib.t
ext/Compress/Zlib/Changes
ext/Compress/Zlib/Makefile.PL
ext/Compress/Zlib/README
ext/Compress/Zlib/lib/Compress/Zlib.pm
ext/Compress/Zlib/t/03zlib-v1.t
ext/IO/Compress/Base/Changes
ext/IO/Compress/Base/Makefile.PL
ext/IO/Compress/Base/README
ext/IO/Compress/Base/lib/IO/Compress/Base.pm
ext/IO/Compress/Base/lib/IO/Compress/Base/Common.pm
ext/IO/Compress/Base/lib/IO/Uncompress/AnyUncompress.pm
ext/IO/Compress/Base/lib/IO/Uncompress/Base.pm
ext/IO/Compress/Zlib/Changes
ext/IO/Compress/Zlib/Makefile.PL
ext/IO/Compress/Zlib/README
ext/IO/Compress/Zlib/lib/IO/Compress/Adapter/Deflate.pm
ext/IO/Compress/Zlib/lib/IO/Compress/Adapter/Identity.pm
ext/IO/Compress/Zlib/lib/IO/Compress/Deflate.pm
ext/IO/Compress/Zlib/lib/IO/Compress/Gzip.pm
ext/IO/Compress/Zlib/lib/IO/Compress/Gzip/Constants.pm
ext/IO/Compress/Zlib/lib/IO/Compress/RawDeflate.pm
ext/IO/Compress/Zlib/lib/IO/Compress/Zip.pm
ext/IO/Compress/Zlib/lib/IO/Compress/Zip/Constants.pm
ext/IO/Compress/Zlib/lib/IO/Compress/Zlib/Constants.pm
ext/IO/Compress/Zlib/lib/IO/Compress/Zlib/Extra.pm
ext/IO/Compress/Zlib/lib/IO/Uncompress/Adapter/Identity.pm
ext/IO/Compress/Zlib/lib/IO/Uncompress/Adapter/Inflate.pm
ext/IO/Compress/Zlib/lib/IO/Uncompress/AnyInflate.pm
ext/IO/Compress/Zlib/lib/IO/Uncompress/Gunzip.pm
ext/IO/Compress/Zlib/lib/IO/Uncompress/Inflate.pm
ext/IO/Compress/Zlib/lib/IO/Uncompress/RawInflate.pm
ext/IO/Compress/Zlib/lib/IO/Uncompress/Unzip.pm
ext/IO/Compress/Zlib/t/050interop-gzip.t
t/lib/compress/generic.pl
t/lib/compress/merge.pl

index 1295b1e..ef8ddab 100644 (file)
@@ -1,6 +1,12 @@
 CHANGES
 -------
 
+  2.004 3 March 2007
+
+      * Fixed lvalue substr issue
+
+      * Remove redundant code from Zlib.xs
+
   2.003 2 January 2007
 
       * Added explicit version checking
index 294c87f..7629725 100644 (file)
@@ -95,6 +95,9 @@ WriteMakefile(
         : ()
     ),
 
+    ((ExtUtils::MakeMaker->VERSION() gt '6.30') ?
+        ('LICENSE'  => 'perl')         : ()),    
+
 ) ;
 
 my @names = qw(
index 4e0e246..35bd1c2 100644 (file)
@@ -1,9 +1,9 @@
 
                              Compress::Raw::Zlib
 
-                             Version 2.003
+                             Version 2.004
 
-                             2nd January 2007
+                              3rd March 2007
 
 
        Copyright (c) 2005-2007 Paul Marquess. All rights reserved.
@@ -391,7 +391,7 @@ To help me help you, I need all of the following information:
           $VERSION = "1.05" ;
 
 
-     c. The version of zlib you have installed.
+     c. The version of zlib you have used.
         If you have successfully installed Compress::Raw::Zlib, this one-liner
         will tell you:
 
index f638e82..08ffc56 100644 (file)
@@ -3,7 +3,7 @@
  * Created : 22nd January 1996
  * Version : 2.000
  *
- *   Copyright (c) 1995-2005 Paul Marquess. All rights reserved.
+ *   Copyright (c) 1995-2007 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.
  *
@@ -150,8 +150,6 @@ typedef di_stream * inflateStream ;
 typedef di_stream * Compress__Raw__Zlib__inflateStream ;
 typedef di_stream * Compress__Raw__Zlib__inflateScanStream ;
 
-#define GZERRNO "Compress::Zlib::gzerrno"
-
 #define ZMALLOC(to, typ) ((to = (typ *)safemalloc(sizeof(typ))), \
                                 Zero(to,1,typ))
 
@@ -283,51 +281,6 @@ int error_no ;
     return errstr ;
 }
 
-#if 0
-static void
-#ifdef CAN_PROTOTYPE
-SetGzErrorNo(int error_no)
-#else
-SetGzErrorNo(error_no)
-int error_no ;
-#endif
-{
-    dTHX;
-    char * errstr ;
-    SV * gzerror_sv = perl_get_sv(GZERRNO, FALSE) ;
-  
-    if (error_no == Z_ERRNO) {
-        error_no = errno ;
-        errstr = Strerror(errno) ;
-    }
-    else
-        /* errstr = gzerror(fil, &error_no) ; */
-        errstr = (char*) my_z_errmsg[2 - error_no]; 
-
-    if (SvIV(gzerror_sv) != error_no) {
-        sv_setiv(gzerror_sv, error_no) ;
-        sv_setpv(gzerror_sv, errstr) ;
-        SvIOK_on(gzerror_sv) ;
-    }
-
-}
-
-
-static void
-#ifdef CAN_PROTOTYPE
-SetGzError(gzFile file)
-#else
-SetGzError(file)
-gzFile file ;
-#endif
-{
-    int error_no ;
-
-    (void)gzerror(file, &error_no) ;
-    SetGzErrorNo(error_no) ;
-}
-
-#endif
 
 #ifdef MAGIC_APPEND
 
@@ -987,10 +940,10 @@ deflate (s, buf, output)
     if (RETVAL == Z_OK) {
         SvPOK_only(output);
         SvCUR_set(output, cur_length + increment - s->stream.avail_out) ;
+        SvSETMAGIC(output);
     }
     OUTPUT:
        RETVAL
-       output
   
 
 void
@@ -1091,10 +1044,10 @@ flush(s, output, f=Z_FINISH)
     if (RETVAL == Z_OK) {
         SvPOK_only(output);
         SvCUR_set(output, cur_length + increment - s->stream.avail_out) ;
+        SvSETMAGIC(output);
     }
     OUTPUT:
        RETVAL
-       output
 
 
 DualType
@@ -1402,6 +1355,7 @@ inflate (s, buf, output, eof=FALSE)
         if (out_utf8)
             sv_utf8_upgrade(output);
 #endif        
+        SvSETMAGIC(output);
 
         if (s->flags & FLAG_CRC32 )
             s->crc32 = crc32(s->crc32, 
@@ -1425,8 +1379,6 @@ inflate (s, buf, output, eof=FALSE)
     }
     OUTPUT:
        RETVAL
-       buf
-       output
 
 uLong
 inflateCount(s)
@@ -1488,7 +1440,6 @@ inflateSync (s, buf)
     }
     OUTPUT:
        RETVAL
-       buf
 
 void
 DESTROY(s)
index 70e46df..3b81b6c 100644 (file)
@@ -13,7 +13,7 @@ use warnings ;
 use bytes ;
 our ($VERSION, $XS_VERSION, @ISA, @EXPORT, $AUTOLOAD);
 
-$VERSION = '2.003';
+$VERSION = '2.004';
 $XS_VERSION = $VERSION; 
 $VERSION = eval $VERSION;
 
index ef4aef5..4550f05 100644 (file)
@@ -701,8 +701,7 @@ if ($] >= 5.005)
     ok my $k = new Compress::Raw::Zlib::Inflate ( -AppendOutput => 1,
                                              -ConsumeInput => 1 ) ;
      
-#    cmp_ok $k->inflate(substr($X, 0, -1), $Z), '==', Z_STREAM_END ; ;
-    cmp_ok $k->inflate(substr($X, 0), $Z), '==', Z_STREAM_END ; ;
+    cmp_ok $k->inflate(substr($X, 0, -1), $Z), '==', Z_STREAM_END ; ;
      
     ok $hello eq $Z ;
     is $X, $append;
@@ -755,7 +754,10 @@ foreach (1 .. 2)
     
     cmp_ok  $x->flush(substr($Answer, length($Answer))), '==', Z_OK ;
      
+    #cmp_ok length $Answer, ">", 0 ;
+
     my @Answer = split('', $Answer) ;
+    
      
     my $k;
     ok(($k, $err) = new Compress::Raw::Zlib::Inflate(-AppendOutput => 1) );
index 73ebd53..8c02d4b 100644 (file)
@@ -1,6 +1,10 @@
 CHANGES
 -------
 
+  2.004 3 March 2007
+
+      * rewrote memGzip using IO::Compress::Gzip::gzip
+
   2.003 2 January 2007
 
       * Added explicit version checking
index d2d2e1a..a7e3a6a 100755 (executable)
@@ -3,7 +3,7 @@
 use strict ;
 require 5.004 ;
 
-$::VERSION = '2.003' ;
+$::VERSION = '2.004' ;
 
 use private::MakeUtil;
 use ExtUtils::MakeMaker 5.16 ;
@@ -42,6 +42,9 @@ WriteMakefile(
         : ()
     ),
 
+    ((ExtUtils::MakeMaker->VERSION() gt '6.30') ?
+        ('LICENSE'  => 'perl')         : ()),    
+
 ) ;
 
 # end of file Makefile.PL
index 263eb7b..7d2f0de 100644 (file)
@@ -1,9 +1,9 @@
 
                              Compress::Zlib
 
-                             Version 2.003
+                             Version 2.004
 
-                             2nd January 2007
+                              3rd March 2007
 
 
        Copyright (c) 1995-2007 Paul Marquess. All rights reserved.
index e8e9da3..fe18926 100644 (file)
@@ -8,17 +8,17 @@ use Carp ;
 use IO::Handle ;
 use Scalar::Util qw(dualvar);
 
-use IO::Compress::Base::Common 2.003 ;
-use Compress::Raw::Zlib 2.003 ;
-use IO::Compress::Gzip 2.003 ;
-use IO::Uncompress::Gunzip 2.003 ;
+use IO::Compress::Base::Common 2.004 ;
+use Compress::Raw::Zlib 2.004 ;
+use IO::Compress::Gzip 2.004 ;
+use IO::Uncompress::Gunzip 2.004 ;
 
 use strict ;
 use warnings ;
 use bytes ;
 our ($VERSION, $XS_VERSION, @ISA, @EXPORT, $AUTOLOAD);
 
-$VERSION = '2.003';
+$VERSION = '2.004';
 $XS_VERSION = $VERSION; 
 $VERSION = eval $VERSION;
 
@@ -438,35 +438,19 @@ sub inflate
 
 package Compress::Zlib ;
 
-use IO::Compress::Gzip::Constants 2.003 ;
+use IO::Compress::Gzip::Constants 2.004 ;
 
 sub memGzip($)
 {
-  my $x = new Compress::Raw::Zlib::Deflate(
-                      -AppendOutput  => 1,
-                      -CRC32         => 1,
-                      -ADLER32       => 0,
-                      -Level         => Z_BEST_COMPRESSION(),
-                      -WindowBits    => - MAX_WBITS(),
-                     )
-      or return undef ;
-  # write a minimal gzip header
-  my $output = GZIP_MINIMUM_HEADER ;
+  my $out;
+
   # if the deflation buffer isn't a reference, make it one
   my $string = (ref $_[0] ? $_[0] : \$_[0]) ;
 
-  my $status = $x->deflate($string, \$output) ;
-  $status == Z_OK()
+  IO::Compress::Gzip::gzip($string, \$out, Minimal => 1)
       or return undef ;
-  $status = $x->flush(\$output) ;
-  $status == Z_OK()
-      or return undef ;
-  return $output . pack("V V", $x->crc32(), $x->total_in()) ;
+
+  return $out;
 }
 
 
index 0ad5440..d46c224 100644 (file)
@@ -857,8 +857,8 @@ if ($] >= 5.005)
      
     ok $k = inflateInit() ;
      
-    #$Z = $k->inflate(substr($Y, 0, -1)) ;
-    $Z = $k->inflate(substr($Y, 0)) ;
+    $Z = $k->inflate(substr($Y, 0, -1)) ;
+    #$Z = $k->inflate(substr($Y, 0)) ;
      
     ok $contents eq $Z ;
     is $Y, $append;
index f7357f1..24e88f0 100644 (file)
@@ -1,6 +1,10 @@
 CHANGES
 -------
 
+  2.004 3 March 2007
+
+      * Made seek less wasteful of memory.
+
   2.003 2 January 2007
 
       * Added explicit version checking
index 3b5518f..751538a 100644 (file)
@@ -35,6 +35,9 @@ WriteMakefile(
         : ()
     ),
 
+    ((ExtUtils::MakeMaker->VERSION() gt '6.30') ?
+        ('LICENSE'  => 'perl')         : ()),
+    
 ) ;
 
 # end of file Makefile.PL
index ba41fd0..1e557c9 100644 (file)
@@ -1,9 +1,9 @@
 
                              IO::Compress::Base
 
-                             Version 2.003
+                             Version 2.004
 
-                             2nd January 2007
+                              3rd March 2007
 
 
        Copyright (c) 2005-2007 Paul Marquess. All rights reserved.
index 47f26ef..8617b56 100644 (file)
@@ -6,7 +6,7 @@ require 5.004 ;
 use strict ;
 use warnings;
 
-use IO::Compress::Base::Common 2.003 ;
+use IO::Compress::Base::Common 2.004 ;
 
 use IO::File ;
 use Scalar::Util qw(blessed readonly);
@@ -17,22 +17,13 @@ use Carp ;
 use Symbol;
 use bytes;
 
-our (@ISA, $VERSION, $got_encode);
+our (@ISA, $VERSION);
 #@ISA    = qw(Exporter IO::File);
 
-$VERSION = '2.003';
+$VERSION = '2.004';
 
 #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.
 
-#$got_encode = 0;
-#eval
-#{
-#    require Encode;
-#    Encode->import('encode', 'find_encoding');
-#};
-#
-#$got_encode = 1 unless $@;
-
 sub saveStatus
 {
     my $self   = shift ;
@@ -157,7 +148,7 @@ sub checkParams
         {
             # Generic Parameters
             'AutoClose' => [1, 1, Parse_boolean,   0],
-           #'Encoding'  => [1, 1, Parse_any,       undef],
+            #'Encode'    => [1, 1, Parse_any,       undef],
             'Strict'    => [0, 1, Parse_boolean,   1],
             'Append'    => [1, 1, Parse_boolean,   0],
             'BinModeIn' => [1, 1, Parse_boolean,   0],
@@ -229,19 +220,10 @@ sub _create
 
 
 
-#    TODO - encoding
-#    if ($got->parsed('Encoding')) { 
-#        $obj->croakError("$class: Encode module needed to use -Encoding")
-#            if ! $got_encode;
-#
-#        my $want_encoding = $got->value('Encoding');
-#        my $encoding = find_encoding($want_encoding);
-#
-#        $obj->croakError("$class: Encoding '$want_encoding' is not available")
-#           if ! $encoding;
-#
-#        *$obj->{Encoding} = $encoding;
-#    }
+    if ($got->parsed('Encode')) { 
+        my $want_encoding = $got->value('Encode');
+        *$obj->{Encoding} = getEncoding($obj, $class, $want_encoding);
+    }
 
     $obj->ckParams($got)
         or $obj->croakError("${class}: " . $obj->error());
@@ -616,14 +598,14 @@ sub syswrite
 
     return 0 if ! defined $$buffer || length $$buffer == 0 ;
 
-    my $buffer_length = defined $$buffer ? length($$buffer) : 0 ;
-    *$self->{UnCompSize}->add($buffer_length) ;
+    if (*$self->{Encoding}) {
+        $$buffer = *$self->{Encoding}->encode($$buffer);
+    }
 
     $self->filterUncompressed($buffer);
 
-#    if (*$self->{Encoding}) {
-#        $$buffer = *$self->{Encoding}->encode($$buffer);
-#    }
+    my $buffer_length = defined $$buffer ? length($$buffer) : 0 ;
+    *$self->{UnCompSize}->add($buffer_length) ;
 
     my $outBuffer='';
     my $status = *$self->{Compress}->compr($buffer, $outBuffer) ;
index dc772a8..9c0b6fd 100644 (file)
@@ -9,15 +9,16 @@ use Scalar::Util qw(blessed readonly);
 use File::GlobMapper;
 
 require Exporter;
-our ($VERSION, @ISA, @EXPORT, %EXPORT_TAGS);
+our ($VERSION, @ISA, @EXPORT, %EXPORT_TAGS, $HAS_ENCODE);
 @ISA = qw(Exporter);
-$VERSION = '2.003';
+$VERSION = '2.004';
 
 @EXPORT = qw( isaFilehandle isaFilename whatIsInput whatIsOutput 
               isaFileGlobString cleanFileGlobString oneTarget
               setBinModeInput setBinModeOutput
               ckInOutParams 
               createSelfTiedObject
+              getEncoding
 
               WANT_CODE
               WANT_EXT
@@ -41,11 +42,39 @@ use constant STATUS_OK        => 0;
 use constant STATUS_ENDSTREAM => 1;
 use constant STATUS_EOF       => 2;
 use constant STATUS_ERROR     => -1;
-#use constant STATUS_OK        =>  0;
-#use constant STATUS_ENDSTREAM =>  1;
-#use constant STATUS_ERROR     =>  2;
-#use constant STATUS_EOF       =>  3;
           
+sub hasEncode()
+{
+    if (! defined $HAS_ENCODE) {
+        eval
+        {
+            require Encode;
+            Encode->import();
+        };
+
+        $HAS_ENCODE = $@ ? 0 : 1 ;
+    }
+
+    return $HAS_ENCODE;
+}
+
+sub getEncoding($$$)
+{
+    my $obj = shift;
+    my $class = shift ;
+    my $want_encoding = shift ;
+
+    $obj->croakError("$class: Encode module needed to use -Encode")
+        if ! hasEncode();
+
+    my $encoding = Encode::find_encoding($want_encoding);
+
+    $obj->croakError("$class: Encoding '$want_encoding' is not available")
+       if ! $encoding;
+
+    return $encoding;
+}
+
 our ($needBinmode);
 $needBinmode = ($^O eq 'MSWin32' || 
                     ($] >= 5.006 && eval ' ${^UNICODE} || ${^UTF8LOCALE} '))
index 8657c18..923aa83 100644 (file)
@@ -4,16 +4,16 @@ use strict;
 use warnings;
 use bytes;
 
-use IO::Compress::Base::Common 2.003 qw(createSelfTiedObject);
+use IO::Compress::Base::Common 2.004 qw(createSelfTiedObject);
 
-use IO::Uncompress::Base 2.003 ;
+use IO::Uncompress::Base 2.004 ;
 
 
 require Exporter ;
 
 our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $AnyUncompressError);
 
-$VERSION = '2.003';
+$VERSION = '2.004';
 $AnyUncompressError = '';
 
 @ISA = qw( Exporter IO::Uncompress::Base );
@@ -27,18 +27,18 @@ Exporter::export_ok_tags('all');
 
 BEGIN
 {
-   eval ' use IO::Uncompress::Adapter::Inflate 2.003 ;';
-   eval ' use IO::Uncompress::Adapter::Bunzip2 2.003 ;';
-   eval ' use IO::Uncompress::Adapter::LZO 2.003 ;';
-   eval ' use IO::Uncompress::Adapter::Lzf 2.003 ;';
-
-   eval ' use IO::Uncompress::Bunzip2 2.003 ;';
-   eval ' use IO::Uncompress::UnLzop 2.003 ;';
-   eval ' use IO::Uncompress::Gunzip 2.003 ;';
-   eval ' use IO::Uncompress::Inflate 2.003 ;';
-   eval ' use IO::Uncompress::RawInflate 2.003 ;';
-   eval ' use IO::Uncompress::Unzip 2.003 ;';
-   eval ' use IO::Uncompress::UnLzf 2.003 ;';
+   eval ' use IO::Uncompress::Adapter::Inflate 2.004 ;';
+   eval ' use IO::Uncompress::Adapter::Bunzip2 2.004 ;';
+   eval ' use IO::Uncompress::Adapter::LZO 2.004 ;';
+   eval ' use IO::Uncompress::Adapter::Lzf 2.004 ;';
+
+   eval ' use IO::Uncompress::Bunzip2 2.004 ;';
+   eval ' use IO::Uncompress::UnLzop 2.004 ;';
+   eval ' use IO::Uncompress::Gunzip 2.004 ;';
+   eval ' use IO::Uncompress::Inflate 2.004 ;';
+   eval ' use IO::Uncompress::RawInflate 2.004 ;';
+   eval ' use IO::Uncompress::Unzip 2.004 ;';
+   eval ' use IO::Uncompress::UnLzf 2.004 ;';
 }
 
 sub new
@@ -56,7 +56,7 @@ sub anyuncompress
 
 sub getExtraParams
 {
-    use IO::Compress::Base::Common 2.003 qw(:Parse);
+    use IO::Compress::Base::Common 2.004 qw(:Parse);
     return ( 'RawInflate' => [1, 1, Parse_boolean,  0] ) ;
 }
 
index 709d705..1563dba 100644 (file)
@@ -10,12 +10,12 @@ our (@ISA, $VERSION, @EXPORT_OK, %EXPORT_TAGS);
 @ISA    = qw(Exporter );
 
 
-$VERSION = '2.003';
+$VERSION = '2.004';
 
 use constant G_EOF => 0 ;
 use constant G_ERR => -1 ;
 
-use IO::Compress::Base::Common 2.003 ;
+use IO::Compress::Base::Common 2.004 ;
 #use Parse::Parameters ;
 
 use IO::File ;
@@ -301,6 +301,8 @@ sub checkParams
                     'Scan'          => [1, 1, Parse_boolean,  0],
                     'InputLength'   => [1, 1, Parse_unsigned, undef],
                     'BinModeOut'    => [1, 1, Parse_boolean,  0],
+                    #'Encode'        => [1, 1, Parse_any,       undef],
+
                    #'ConsumeInput'  => [1, 1, Parse_boolean,  0],
 
                     $self->getExtraParams(),
@@ -380,6 +382,11 @@ sub _create
         *$obj->{Buffer} = \$buff ;
     }
 
+    if ($got->parsed('Encode')) { 
+        my $want_encoding = $got->value('Encode');
+        *$obj->{Encoding} = getEncoding($obj, $class, $want_encoding);
+    }
+
 
     *$obj->{InputLength}       = $got->parsed('InputLength') 
                                     ? $got->value('InputLength')
@@ -807,19 +814,19 @@ sub _raw_read
         $self->postBlockChk($buffer, $before_len) == STATUS_OK
             or return G_ERR;
 
-        $self->filterUncompressed($buffer);
-
-        # TODO uncompress filter goes here    
-
-
         $buf_len = length($$buffer) - $before_len;
-
     
         *$self->{CompSize}->add($beforeC_len - length $temp_buf) ;
 
         *$self->{InflatedBytesRead} += $buf_len ;
         *$self->{TotalInflatedBytesRead} += $buf_len ;
         *$self->{UnCompSize}->add($buf_len) ;
+
+        $self->filterUncompressed($buffer);
+
+        if (*$self->{Encoding}) {
+            $$buffer = *$self->{Encoding}->decode($$buffer);
+        }
     }
 
     if ($status == STATUS_ENDSTREAM) {
@@ -1271,11 +1278,14 @@ sub seek
     # Walk the file to the new offset
     my $offset = $target - $here ;
 
-    my $buffer ;
-    $self->read($buffer, $offset) == $offset
-        or return 0 ;
+    my $got;
+    while (($got = $self->read(my $buffer, min($offset, *$self->{BlockSize})) ) > 0)
+    {
+        $offset -= $got;
+        last if $offset == 0 ;
+    }
 
-    return 1 ;
+    return $offset == 0 ? 1 : 0 ;
 }
 
 sub fileno
index 4e616b4..e5c95f8 100644 (file)
@@ -1,6 +1,28 @@
 CHANGES
 -------
 
+  2.004 3 March 2007
+
+      * IO::Compress::Zip 
+
+        - Added Zip64 documentation.
+
+        - Fixed extended timestamp.  
+          Creation time isn't available in Unix so only store the
+          modification time and the last access time in the extended field.
+
+        - Fixed file mode.
+
+        - Added ExtAttr option to control the value of the "external file
+          attributes" field in the central directory.
+
+        - Added Unix2 extended attribute ("Ux"). 
+          This stores the UID & GID.
+
+      * IO::Compress::Gzip 
+
+        - Fixed 050interop-gzip.t for Windows 
+
   2.003 2 January 2007
 
       * Added explicit version checking
index 0368115..4d38fc7 100644 (file)
@@ -3,7 +3,7 @@
 use strict ;
 require 5.004 ;
 
-$::VERSION = '2.003' ;
+$::VERSION = '2.004' ;
 
 use private::MakeUtil;
 use ExtUtils::MakeMaker 5.16 ;
@@ -39,6 +39,9 @@ WriteMakefile(
         : ()
     ),
 
+    ((ExtUtils::MakeMaker->VERSION() gt '6.30') ?
+        ('LICENSE'  => 'perl')         : ()),    
+
 ) ;
 
 # end of file Makefile.PL
index 9bdda20..d0e48d4 100644 (file)
@@ -1,9 +1,9 @@
 
                              IO::Compress::Zlib
 
-                             Version 2.003
+                             Version 2.004
 
-                             2nd January 2007
+                              3rd March 2007
 
 
        Copyright (c) 2005-2007 Paul Marquess. All rights reserved.
index c8b43bd..1937c7c 100644 (file)
@@ -4,12 +4,12 @@ use strict;
 use warnings;
 use bytes;
 
-use IO::Compress::Base::Common  2.003 qw(:Status);
+use IO::Compress::Base::Common  2.004 qw(:Status);
 
-use Compress::Raw::Zlib  2.003 qw(Z_OK Z_FINISH MAX_WBITS) ;
+use Compress::Raw::Zlib  2.004 qw(Z_OK Z_FINISH MAX_WBITS) ;
 our ($VERSION);
 
-$VERSION = '2.003';
+$VERSION = '2.004';
 
 sub mkCompObject
 {
index 15af467..596b670 100644 (file)
@@ -4,10 +4,10 @@ use strict;
 use warnings;
 use bytes;
 
-use IO::Compress::Base::Common  2.003 qw(:Status);
+use IO::Compress::Base::Common  2.004 qw(:Status);
 our ($VERSION);
 
-$VERSION = '2.003';
+$VERSION = '2.004';
 
 sub mkCompObject
 {
index ff69332..0015505 100644 (file)
@@ -6,16 +6,16 @@ use bytes;
 
 require Exporter ;
 
-use IO::Compress::RawDeflate 2.003 ;
+use IO::Compress::RawDeflate 2.004 ;
 
-use Compress::Raw::Zlib  2.003 ;
-use IO::Compress::Zlib::Constants 2.003 ;
-use IO::Compress::Base::Common  2.003 qw(createSelfTiedObject);
+use Compress::Raw::Zlib  2.004 ;
+use IO::Compress::Zlib::Constants 2.004 ;
+use IO::Compress::Base::Common  2.004 qw(createSelfTiedObject);
 
 
 our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $DeflateError);
 
-$VERSION = '2.003';
+$VERSION = '2.004';
 $DeflateError = '';
 
 @ISA    = qw(Exporter IO::Compress::RawDeflate);
index c4253b6..5d16564 100644 (file)
@@ -8,12 +8,12 @@ use warnings;
 use bytes;
 
 
-use IO::Compress::RawDeflate 2.003 ;
+use IO::Compress::RawDeflate 2.004 ;
 
-use Compress::Raw::Zlib  2.003 ;
-use IO::Compress::Base::Common  2.003 qw(:Status :Parse createSelfTiedObject);
-use IO::Compress::Gzip::Constants 2.003 ;
-use IO::Compress::Zlib::Extra 2.003 ;
+use Compress::Raw::Zlib  2.004 ;
+use IO::Compress::Base::Common  2.004 qw(:Status :Parse createSelfTiedObject);
+use IO::Compress::Gzip::Constants 2.004 ;
+use IO::Compress::Zlib::Extra 2.004 ;
 
 BEGIN
 {
@@ -27,7 +27,7 @@ require Exporter ;
 
 our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $GzipError);
 
-$VERSION = '2.003';
+$VERSION = '2.004';
 $GzipError = '' ;
 
 @ISA    = qw(Exporter IO::Compress::RawDeflate);
index 4e47f73..3ccb042 100644 (file)
@@ -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.003';
+$VERSION = '2.004';
 
 @ISA = qw(Exporter);
 
index 0cd340b..11a2ae3 100644 (file)
@@ -7,16 +7,16 @@ use warnings;
 use bytes;
 
 
-use IO::Compress::Base 2.003 ;
-use IO::Compress::Base::Common  2.003 qw(:Status createSelfTiedObject);
-use IO::Compress::Adapter::Deflate  2.003 ;
+use IO::Compress::Base 2.004 ;
+use IO::Compress::Base::Common  2.004 qw(:Status createSelfTiedObject);
+use IO::Compress::Adapter::Deflate  2.004 ;
 
 require Exporter ;
 
 
 our ($VERSION, @ISA, @EXPORT_OK, %DEFLATE_CONSTANTS, %EXPORT_TAGS, $RawDeflateError);
 
-$VERSION = '2.003';
+$VERSION = '2.004';
 $RawDeflateError = '';
 
 @ISA = qw(Exporter IO::Compress::Base);
@@ -141,8 +141,8 @@ sub getZlibParams
 {
     my $self = shift ;
 
-    use IO::Compress::Base::Common  2.003 qw(:Parse);
-    use Compress::Raw::Zlib  2.003 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY);
+    use IO::Compress::Base::Common  2.004 qw(:Parse);
+    use Compress::Raw::Zlib  2.004 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY);
 
     
     return (
index 899cbbe..143760e 100644 (file)
@@ -4,21 +4,21 @@ use strict ;
 use warnings;
 use bytes;
 
-use IO::Compress::Base::Common  2.003 qw(:Status createSelfTiedObject);
-use IO::Compress::RawDeflate 2.003 ;
-use IO::Compress::Adapter::Deflate 2.003 ;
-use IO::Compress::Adapter::Identity 2.003 ;
-use IO::Compress::Zlib::Extra 2.003 ;
-use IO::Compress::Zip::Constants 2.003 ;
+use IO::Compress::Base::Common  2.004 qw(:Status createSelfTiedObject);
+use IO::Compress::RawDeflate 2.004 ;
+use IO::Compress::Adapter::Deflate 2.004 ;
+use IO::Compress::Adapter::Identity 2.004 ;
+use IO::Compress::Zlib::Extra 2.004 ;
+use IO::Compress::Zip::Constants 2.004 ;
 
 
-use Compress::Raw::Zlib  2.003 qw(crc32) ;
+use Compress::Raw::Zlib  2.004 qw(crc32) ;
 BEGIN
 {
     eval { require IO::Compress::Adapter::Bzip2 ; 
-           import  IO::Compress::Adapter::Bzip2 2.003 ; 
+           import  IO::Compress::Adapter::Bzip2 2.004 ; 
            require IO::Compress::Bzip2 ; 
-           import  IO::Compress::Bzip2 2.003 ; 
+           import  IO::Compress::Bzip2 2.004 ; 
          } ;
 }
 
@@ -27,7 +27,7 @@ require Exporter ;
 
 our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $ZipError);
 
-$VERSION = '2.003';
+$VERSION = '2.004';
 $ZipError = '';
 
 @ISA = qw(Exporter IO::Compress::RawDeflate);
@@ -139,6 +139,8 @@ sub mkHeader
     my $extra = '';
     my $ctlExtra = '';
     my $empty = 0;
+    my $osCode = $param->value('OS_Code') ;
+    my $extFileAttr = 0 ;
 
     if (*$self->{ZipData}{Zip64}) {
         $empty = 0xFFFF;
@@ -164,11 +166,18 @@ sub mkHeader
             $ctlExtra .= mkExtendedTime($param->value('MTime'));
         }
 
-    #    if ( $param->value('UID'))
-    #    {
-    #        $extra    .= mkUnixExtra( $param->value('UID'), $param->value('GID'));
-    #        $ctlExtra .= mkUnixExtra();
-    #    }
+        if ( $param->value('UID') && $osCode == ZIP_OS_CODE_UNIX)
+        {
+            $extra    .= mkUnix2Extra( $param->value('UID'), $param->value('GID'));
+            $ctlExtra .= mkUnix2Extra();
+        }
+
+        # TODO - this code assumes Unix.
+        #$extFileAttr = 0666 << 16 
+        #    if $osCode == ZIP_OS_CODE_UNIX ;
+
+        $extFileAttr = $param->value('ExtAttr') 
+            if defined $param->value('ExtAttr') ;
 
         $extra .= $param->value('ExtraFieldLocal') 
             if defined $param->value('ExtraFieldLocal');
@@ -177,12 +186,6 @@ sub mkHeader
             if defined $param->value('ExtraFieldCentral');
     }
 
-
-    # TODO - this code assumes Unix.
-    my $extAttr = 0;
-    $extAttr = $param->value('Mode') << 16
-        if defined $param->value('Mode') ;
-
     my $gpFlag = 0 ;    
     $gpFlag |= ZIP_GP_FLAG_STREAMING_MASK
         if *$self->{ZipData}{Stream} ;
@@ -233,7 +236,7 @@ sub mkHeader
     $ctl .= pack 'v', length $comment ;  # file comment length
     $ctl .= pack 'v', 0          ; # disk number start 
     $ctl .= pack 'v', $ifa       ; # internal file attributes
-    $ctl .= pack 'V', $extAttr   ; # external file attributes
+    $ctl .= pack 'V', $extFileAttr   ; # external file attributes
     if (! *$self->{ZipData}{Zip64}) {
         $ctl .= pack 'V', *$self->{ZipData}{Offset}->get32bit()  ; # offset to local header
     }
@@ -438,8 +441,8 @@ sub getExtraParams
 {
     my $self = shift ;
 
-    use IO::Compress::Base::Common  2.003 qw(:Parse);
-    use Compress::Raw::Zlib  2.003 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY);
+    use IO::Compress::Base::Common  2.004 qw(:Parse);
+    use Compress::Raw::Zlib  2.004 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY);
 
     my @Bzip2 = ();
     
@@ -462,6 +465,7 @@ sub getExtraParams
             'Name'      => [0, 1, Parse_any,       ''],
             'Time'      => [0, 1, Parse_any,       undef],
             'exTime'    => [0, 1, Parse_any,       undef],
+            'ExtAttr'   => [0, 1, Parse_any,       0],
             'OS_Code'   => [0, 1, Parse_unsigned,  $Compress::Raw::Zlib::gzip_os_code],
             
            'TextFlag'  => [0, 1, Parse_boolean,   0],
@@ -497,10 +501,11 @@ sub getFileInfo
     {
         $params->value('MTime' => $mtime) ;
         $params->value('ATime' => $atime) ;
-        $params->value('CTime' => $ctime) ;
+        $params->value('CTime' => undef) ; # No Creation time
     }
 
-    $params->value('Mode' => $mode) ;
+    $params->value('ExtAttr' => $mode << 16) 
+        if ! $params->parsed('ExtAttr');
 
     $params->value('UID' => $uid) ;
     $params->value('GID' => $gid) ;
@@ -526,12 +531,11 @@ sub mkExtendedTime
         $bit <<= 1 ;
     }
 
-    #return "UT" . pack("v C", length($times) + 1, $flags) . $times;
     return IO::Compress::Zlib::Extra::mkSubField(ZIP_EXTRA_ID_EXT_TIMESTAMP,
                                                  pack("C", $flags) .  $times);
 }
 
-sub mkUnixExtra
+sub mkUnix2Extra
 {
     my $ids = '';
     for my $id (@_)
@@ -539,8 +543,8 @@ sub mkUnixExtra
         $ids .= pack("v", $id);
     }
 
-    #return "Ux" . pack("v", length $ids) . $ids;
-    return IO::Compress::Zlib::Extra::mkSubField(ZIP_EXTRA_ID_INFO_ZIP_UNIX, $ids);
+    return IO::Compress::Zlib::Extra::mkSubField(ZIP_EXTRA_ID_INFO_ZIP_UNIX2, 
+                                                 $ids);
 }
 
 
@@ -630,11 +634,16 @@ compressed data to files or buffer.
 
 
 
-
 The primary purpose of this module is to provide streaming write access to
 zip files and buffers. It is not a general-purpose file archiver. If that
 is what you want, check out C<Archive::Zip>.
 
+At present three compression methods are supported by IO::Compress::Zip,
+namely Store (no compression at all), Deflate and Bzip2.
+
+Note that to create Bzip2 content, the module C<IO::Compress::Bzip2> must
+be installed.
+
 
 
 
@@ -719,10 +728,10 @@ If the C<$input> parameter is any other type, C<undef> will be returned.
 
 
 In addition, if C<$input> is a simple filename, the default values for
-the C<Name>, C<Time> and C<exTime> options will be sourced from that file.
+the C<Name>, C<Time>, C<ExtAttr> and C<exTime> options will be sourced from that file.
 
 If you do not want to use these defaults they can be overridden by
-explicitly setting the C<Name>, C<Time> and C<exTime> options or by setting the
+explicitly setting the C<Name>, C<Time>, C<ExtAttr> and C<exTime> options or by setting the
 C<Minimal> parameter.
 
 
@@ -988,6 +997,13 @@ Sets the last modified time field in the zip header to $number.
 This field defaults to the time the C<IO::Compress::Zip> object was created
 if this option is not specified.
 
+=item C<< ExtAttr => $attr >>
+
+This option controls the "external file attributes" field in the central
+header of the zip file. This is a 4 byte field.
+
+This option defaults to 0.
+
 =item C<< exTime => [$atime, $mtime, $ctime] >>
 
 This option expects an array reference with exactly three elements:
@@ -998,6 +1014,11 @@ It uses these values to set the extended timestamp field in the local zip
 header to the three values, $atime, $mtime, $ctime and sets the extended
 timestamp field in the central zip header to C<$mtime>.
 
+If any of the three values is C<undef> that time value will not be used.
+So, for example, to set only the C<$mtime> you would use this
+
+    exTime => [undef, $mtime, undef]
+
 If the C<Minimal> option is set to true, this option will be ignored.
 
 By default no extended time field is created.
@@ -1047,7 +1068,22 @@ is 0), the output file must be seekable.
 
 The default is 1.
 
+=item C<< Zip64 => 0|1 >>
+
+Create a Zip64 zip file/buffer. This option should only be used if you want
+to store files larger than 4 Gig.
 
+If you intend to manipulate the Zip64 zip files created with this module
+using an external zip/unzip make sure that it supports streaming 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. At the time of writing both are beta status.
+
+When the C<Zip64> option is enabled, the C<Stream> option I<must> be
+enabled as well.
+
+The default is 0.
 
 =item C<< TextFlag => 0|1 >>
 
@@ -1093,6 +1129,9 @@ Alternatively the list of subfields can by supplied as a scalar, thus
 
     ExtraField => $rawdata
 
+The Extended Time field, set using the C<exTime> option, is an example of
+an extended field.
+
 
 
 If the C<Minimal> option is set to true, this option will be ignored.
@@ -1102,7 +1141,8 @@ The maximum size of an extra field 65535 bytes.
 =item C<< Minimal => 1|0 >>
 
 If specified, this option will disable the creation of all extended fields
-in the zip local and central headers.
+in the zip local and central headers. So the C<exTime>, C<ExtraFieldLocal>
+and C<ExtraFieldCentral> options will be ignored.
 
 This parameter defaults to 0.
 
index dc8912d..b0505d6 100644 (file)
@@ -7,7 +7,7 @@ require Exporter;
 
 our ($VERSION, @ISA, @EXPORT, %ZIP_CM_MIN_VERSIONS);
 
-$VERSION = '2.003';
+$VERSION = '2.004';
 
 @ISA = qw(Exporter);
 
@@ -16,6 +16,7 @@ $VERSION = '2.003';
     ZIP_CM_STORE
     ZIP_CM_DEFLATE
     ZIP_CM_BZIP2
+    ZIP_CM_LZMA
     
     ZIP_LOCAL_HDR_SIG
     ZIP_DATA_HDR_SIG
@@ -33,7 +34,10 @@ $VERSION = '2.003';
 
     ZIP_EXTRA_ID_ZIP64
     ZIP_EXTRA_ID_EXT_TIMESTAMP
-    ZIP_EXTRA_ID_INFO_ZIP_UNIX
+    ZIP_EXTRA_ID_INFO_ZIP_UNIX2
+
+    ZIP_OS_CODE_UNIX
+    ZIP_OS_CODE_DEFAULT
 
     ZIP_IFA_TEXT_MASK
 
@@ -46,6 +50,7 @@ $VERSION = '2.003';
 use constant ZIP_CM_STORE                      => 0 ;
 use constant ZIP_CM_DEFLATE                    => 8 ;
 use constant ZIP_CM_BZIP2                      => 12 ;
+use constant ZIP_CM_LZMA                       => 14 ; # Not Supported yet
 
 # General Purpose Flag
 use constant ZIP_GP_FLAG_ENCRYPTED_MASK        => 1 ;
@@ -66,10 +71,13 @@ use constant ZIP64_END_CENTRAL_LOC_HDR_SIG     => 0x07064b50;
 use constant ZIP64_ARCHIVE_EXTRA_SIG           => 0x08064b50;
 use constant ZIP64_DIGITAL_SIGNATURE_SIG       => 0x05054b50;
 
+use constant ZIP_OS_CODE_UNIX                  => 3;
+use constant ZIP_OS_CODE_DEFAULT               => 3;
+
 # Extra Field ID's
 use constant ZIP_EXTRA_ID_ZIP64                => pack "v", 1;
 use constant ZIP_EXTRA_ID_EXT_TIMESTAMP        => "UT";
-use constant ZIP_EXTRA_ID_INFO_ZIP_UNIX        => "Ux";
+use constant ZIP_EXTRA_ID_INFO_ZIP_UNIX2       => "Ux";
 
 use constant ZIP64_MIN_VERSION                 => 45;
 
@@ -77,6 +85,7 @@ use constant ZIP64_MIN_VERSION                 => 45;
             ZIP_CM_STORE()                      => 20,
             ZIP_CM_DEFLATE()                    => 20,
             ZIP_CM_BZIP2()                      => 46,
+            ZIP_CM_LZMA()                       => 63,
             );
 
 
index 694f9ec..492b2e3 100644 (file)
@@ -9,7 +9,7 @@ require Exporter;
 
 our ($VERSION, @ISA, @EXPORT);
 
-$VERSION = '2.003';
+$VERSION = '2.004';
 
 @ISA = qw(Exporter);
 
index 7f9f7b0..4034e3a 100644 (file)
@@ -8,9 +8,9 @@ use bytes;
 
 our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS);
 
-$VERSION = '2.003';
+$VERSION = '2.004';
 
-use IO::Compress::Gzip::Constants 2.003 ;
+use IO::Compress::Gzip::Constants 2.004 ;
 
 sub ExtraFieldError
 {
index 4a3b316..36b9fbb 100644 (file)
@@ -4,13 +4,13 @@ use warnings;
 use strict;
 use bytes;
 
-use IO::Compress::Base::Common  2.003 qw(:Status);
+use IO::Compress::Base::Common  2.004 qw(:Status);
 
 our ($VERSION);
 
-$VERSION = '2.003';
+$VERSION = '2.004';
 
-use Compress::Raw::Zlib  2.003 ();
+use Compress::Raw::Zlib  2.004 ();
 
 sub mkUncompObject
 {
index 96e42cc..6131c14 100644 (file)
@@ -4,11 +4,11 @@ use strict;
 use warnings;
 use bytes;
 
-use IO::Compress::Base::Common  2.003 qw(:Status);
-use Compress::Raw::Zlib  2.003 qw(Z_OK Z_DATA_ERROR Z_STREAM_END Z_FINISH MAX_WBITS);
+use IO::Compress::Base::Common  2.004 qw(:Status);
+use Compress::Raw::Zlib  2.004 qw(Z_OK Z_DATA_ERROR Z_STREAM_END Z_FINISH MAX_WBITS);
 
 our ($VERSION);
-$VERSION = '2.003';
+$VERSION = '2.004';
 
 
 
index 938013f..04c53ba 100644 (file)
@@ -6,22 +6,22 @@ use strict;
 use warnings;
 use bytes;
 
-use IO::Compress::Base::Common  2.003 qw(createSelfTiedObject);
+use IO::Compress::Base::Common  2.004 qw(createSelfTiedObject);
 
-use IO::Uncompress::Adapter::Inflate  2.003 ();
+use IO::Uncompress::Adapter::Inflate  2.004 ();
 
 
-use IO::Uncompress::Base  2.003 ;
-use IO::Uncompress::Gunzip  2.003 ;
-use IO::Uncompress::Inflate  2.003 ;
-use IO::Uncompress::RawInflate  2.003 ;
-use IO::Uncompress::Unzip  2.003 ;
+use IO::Uncompress::Base  2.004 ;
+use IO::Uncompress::Gunzip  2.004 ;
+use IO::Uncompress::Inflate  2.004 ;
+use IO::Uncompress::RawInflate  2.004 ;
+use IO::Uncompress::Unzip  2.004 ;
 
 require Exporter ;
 
 our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $AnyInflateError);
 
-$VERSION = '2.003';
+$VERSION = '2.004';
 $AnyInflateError = '';
 
 @ISA = qw( Exporter IO::Uncompress::Base );
@@ -48,7 +48,7 @@ sub anyinflate
 
 sub getExtraParams
 {
-    use IO::Compress::Base::Common  2.003 qw(:Parse);
+    use IO::Compress::Base::Common  2.004 qw(:Parse);
     return ( 'RawInflate' => [1, 1, Parse_boolean,  0] ) ;
 }
 
index d350bec..75dcf4b 100644 (file)
@@ -9,12 +9,12 @@ use strict ;
 use warnings;
 use bytes;
 
-use IO::Uncompress::RawInflate 2.003 ;
+use IO::Uncompress::RawInflate 2.004 ;
 
-use Compress::Raw::Zlib 2.003 qw( crc32 ) ;
-use IO::Compress::Base::Common 2.003 qw(:Status createSelfTiedObject);
-use IO::Compress::Gzip::Constants 2.003 ;
-use IO::Compress::Zlib::Extra 2.003 ;
+use Compress::Raw::Zlib 2.004 qw( crc32 ) ;
+use IO::Compress::Base::Common 2.004 qw(:Status createSelfTiedObject);
+use IO::Compress::Gzip::Constants 2.004 ;
+use IO::Compress::Zlib::Extra 2.004 ;
 
 require Exporter ;
 
@@ -28,7 +28,7 @@ Exporter::export_ok_tags('all');
 
 $GunzipError = '';
 
-$VERSION = '2.003';
+$VERSION = '2.004';
 
 sub new
 {
@@ -47,7 +47,7 @@ sub gunzip
 
 sub getExtraParams
 {
-    use IO::Compress::Base::Common  2.003 qw(:Parse);
+    use IO::Compress::Base::Common  2.004 qw(:Parse);
     return ( 'ParseExtra' => [1, 1, Parse_boolean,  0] ) ;
 }
 
index d2dc05d..c39170d 100644 (file)
@@ -5,15 +5,15 @@ use strict ;
 use warnings;
 use bytes;
 
-use IO::Compress::Base::Common  2.003 qw(:Status createSelfTiedObject);
-use IO::Compress::Zlib::Constants 2.003 ;
+use IO::Compress::Base::Common  2.004 qw(:Status createSelfTiedObject);
+use IO::Compress::Zlib::Constants 2.004 ;
 
-use IO::Uncompress::RawInflate  2.003 ;
+use IO::Uncompress::RawInflate  2.004 ;
 
 require Exporter ;
 our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $InflateError);
 
-$VERSION = '2.003';
+$VERSION = '2.004';
 $InflateError = '';
 
 @ISA    = qw( Exporter IO::Uncompress::RawInflate );
index f7a3b1e..a811e65 100644 (file)
@@ -5,11 +5,11 @@ use strict ;
 use warnings;
 use bytes;
 
-use Compress::Raw::Zlib  2.003 ;
-use IO::Compress::Base::Common  2.003 qw(:Status createSelfTiedObject);
+use Compress::Raw::Zlib  2.004 ;
+use IO::Compress::Base::Common  2.004 qw(:Status createSelfTiedObject);
 
-use IO::Uncompress::Base  2.003 ;
-use IO::Uncompress::Adapter::Inflate  2.003 ;
+use IO::Uncompress::Base  2.004 ;
+use IO::Uncompress::Adapter::Inflate  2.004 ;
 
 
 
@@ -17,7 +17,7 @@ use IO::Uncompress::Adapter::Inflate  2.003 ;
 require Exporter ;
 our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $RawInflateError);
 
-$VERSION = '2.003';
+$VERSION = '2.004';
 $RawInflateError = '';
 
 @ISA    = qw( Exporter IO::Uncompress::Base );
index 63550e9..cab4d07 100644 (file)
@@ -8,13 +8,13 @@ use strict ;
 use warnings;
 use bytes;
 
-use IO::Uncompress::RawInflate  2.003 ;
-use IO::Compress::Base::Common  2.003 qw(:Status createSelfTiedObject);
-use IO::Uncompress::Adapter::Identity 2.003 ;
-use IO::Compress::Zlib::Extra 2.003 ;
-use IO::Compress::Zip::Constants 2.003 ;
+use IO::Uncompress::RawInflate  2.004 ;
+use IO::Compress::Base::Common  2.004 qw(:Status createSelfTiedObject);
+use IO::Uncompress::Adapter::Identity 2.004 ;
+use IO::Compress::Zlib::Extra 2.004 ;
+use IO::Compress::Zip::Constants 2.004 ;
 
-use Compress::Raw::Zlib  2.003 qw(crc32) ;
+use Compress::Raw::Zlib  2.004 qw(crc32) ;
 
 BEGIN
 {
@@ -27,7 +27,7 @@ require Exporter ;
 
 our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $UnzipError, %headerLookup);
 
-$VERSION = '2.003';
+$VERSION = '2.004';
 $UnzipError = '';
 
 @ISA    = qw(Exporter IO::Uncompress::RawInflate);
@@ -60,7 +60,7 @@ sub unzip
 
 sub getExtraParams
 {
-    use IO::Compress::Base::Common  2.003 qw(:Parse);
+    use IO::Compress::Base::Common  2.004 qw(:Parse);
 
     
     return (
index 8c5788d..22be064 100644 (file)
@@ -86,8 +86,10 @@ sub writeWithGzip
 BEGIN {
 
     # Check external gzip is available
-    my $name = 'gzip';
-    for my $dir (reverse split ":", $ENV{PATH})
+    my $name = $^O =~ /mswin/i ? 'gzip.exe' : 'gzip';
+    my $split = $^O =~ /mswin/i ? ";" : ":";
+
+    for my $dir (reverse split $split, $ENV{PATH})    
     {
         $GZIP = "$dir/$name"
             if -x "$dir/$name" ;
index b11997c..9e808ee 100644 (file)
@@ -18,7 +18,7 @@ BEGIN
     $extra = 1
         if $st ;
 
-    plan(tests => 639 + $extra) ;
+    plan(tests => 641 + $extra) ;
 }
 
 sub myGZreadFile
@@ -653,7 +653,9 @@ EOT
 
             my %opts = () ;
             my $iow = new $CompressClass $name, %opts;
+            is $iow->input_line_number, undef; 
             $iow->print($str) ;
+            is $iow->input_line_number, undef; 
             $iow->close ;
 
             my @tmp;
index 2f893b2..7811966 100644 (file)
@@ -19,7 +19,7 @@ BEGIN
     $extra = 1
         if eval { require Test::NoWarnings ;  import Test::NoWarnings; 1 };
 
-    plan tests => 166 + $extra ;
+    plan tests => 165 + $extra ;
 
 }
 
@@ -32,13 +32,6 @@ sub run
     my $Error           = getErrorRef($CompressClass);
     my $UnError         = getErrorRef($UncompressClass);
 
-
-
-
-    # Check zlib_version and ZLIB_VERSION are the same.
-    is Compress::Raw::Zlib::zlib_version, ZLIB_VERSION, 
-        "ZLIB_VERSION matches Compress::Raw::Zlib::zlib_version" ;
-
     # Tests     
     #   destination is a file that doesn't exist -- should work ok unless AnyDeflate
     #   destination isn't compressed at all