From: Paul Marquess Date: Fri, 12 Aug 2005 16:31:42 +0000 (+0100) Subject: Compress::Zlib 1.37 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5993747cb0925934856962e6b4b72802bd8122dd;p=p5sagit%2Fp5-mst-13.2.git Compress::Zlib 1.37 From: "Paul Marquess" Message-Id: <20050812153145.PWIR17166.aamta12-winn.ispmail.ntl.com@MARQUESSPT21> p4raw-id: //depot/perl@25292 --- diff --git a/ext/Compress/Zlib/Changes b/ext/Compress/Zlib/Changes index 13a385e..afb1f21 100644 --- a/ext/Compress/Zlib/Changes +++ b/ext/Compress/Zlib/Changes @@ -1,6 +1,20 @@ CHANGES ------- + 1.37 - 12 August 2005 + + * Change to t/03examples.t for VMS from Abe Timmerman + + 1.36 - 3 August 2005 + + * Renamed zlib-src-1.2.3 to zlib-src to help VMS + + * Fixed Makefile.PL for VMS + + * Fixed t/03examples.t for VMS + + * Added a couple of notes about incompatibility with Unix compress. + 1.35 - 16 July 2005 * Updated zlib source to 1.2.3 @@ -64,7 +78,7 @@ CHANGES 1.31 - 29 October 2003 * Reinstated the creation of .bak files - $^I seems to need a - backup file on Windows. For OpenVMS, the extenstion _bak is used. + backup file on Windows. For OpenVMS, the extension _bak is used. 1.30 - 28 October 2003 @@ -181,7 +195,7 @@ CHANGES 1.13 - 31st June 2001 - * Make sure config.in is consistant when released. + * Make sure config.in is consistent when released. 1.12 - 28th April 2001 diff --git a/ext/Compress/Zlib/Makefile.PL b/ext/Compress/Zlib/Makefile.PL index 88735b6..b0fc295 100755 --- a/ext/Compress/Zlib/Makefile.PL +++ b/ext/Compress/Zlib/Makefile.PL @@ -22,6 +22,7 @@ my $ZLIB_LIB ; my $ZLIB_INCLUDE ; my $BUILD_ZLIB = 0 ; my $OLD_ZLIB = '' ; +my $EXTRA_DEFINE = ''; my $WALL = ''; #$WALL = ' -Wall '; @@ -66,13 +67,13 @@ EOM ParseCONFIG() ; my @files = ('Zlib.pm', glob("t/*.t"), grep(!/\.bak$/, glob("examples/*"))) ; -UpDowngrade(@files) unless $ENV{PERL_CORE}; +UpDowngrade(@files) unless $ENV{PERL_CORE} ; WriteMakefile( NAME => 'Compress::Zlib', VERSION_FROM => 'Zlib.pm', INC => "-I$ZLIB_INCLUDE" , - DEFINE => "$OLD_ZLIB $WALL" , + DEFINE => "$OLD_ZLIB $WALL $EXTRA_DEFINE" , XS => { 'Zlib.xs' => 'Zlib.c' }, 'depend' => { 'Makefile' => 'config.in' }, 'clean' => { FILES => '*.c constants.h constants.xs' }, @@ -192,9 +193,6 @@ MyTrebleCheck: (echo found unexpected $$^W ; exit 1) @echo All is ok. -Zlib.xs: typemap - @ $(TOUCH) Zlib.xs - EOM return $postamble; @@ -247,6 +245,8 @@ sub ParseCONFIG $ZLIB_LIB = VMS::Filespec::vmspath($ZLIB_LIB); } + $EXTRA_DEFINE = $ENV{EXTRA_DEFINE} if defined $ENV{EXTRA_DEFINE}; + my $y = $ENV{'OLD_ZLIB'} || $Info{'OLD_ZLIB'} ; $OLD_ZLIB = '-DOLD_ZLIB' if $y and $y =~ /^yes|on|true|1$/i; diff --git a/ext/Compress/Zlib/README b/ext/Compress/Zlib/README index e1634c0..02a3122 100644 --- a/ext/Compress/Zlib/README +++ b/ext/Compress/Zlib/README @@ -1,18 +1,18 @@ Compress::Zlib - Version 1.35 + Version 1.37 - 18 July 2005 + 12 August 2005 - Copyright (c) 1995-2005 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. + Copyright (c) 1995-2005 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. - The directory zlib-src contains a subset of the source files copied - directly from zlib version 1.2.2. These files are Copyright(C) - 1995-2004 Jean-loup Gailly and Mark Adler. - Full source for the zlib library is available at - http://www.zlib.org + The directory zlib-src contains a subset of the source files copied + directly from zlib version 1.2.3. These files are Copyright(C) + 1995-2005 Jean-loup Gailly and Mark Adler. + Full source for the zlib library is available at + http://www.zlib.org DESCRIPTION @@ -87,7 +87,7 @@ library is used: 2. Build a private copy of the zlib library using a standard zlib source distribution. - 3. Use a pre-buiild zlib library. + 3. Use a pre-built zlib library. Note that if you intend to use either Option 2 or 3, you need to have zlib version 1.0.6 or better. Although this module can build with old @@ -340,7 +340,7 @@ Some versions of Mac OS X are failing a number of the tests in the 06gzdopen.t test harness. The functionality being exercised in these tests is checking that it is -possible to call gzopen with an existing Perl filenhandle instead of a +possible to call gzopen with an existing Perl filehandle instead of a filename. For some reason it does not seem possible to extract a numeric file descriptor (using fileno) from a FILE* and then make use of it. diff --git a/ext/Compress/Zlib/Zlib.pm b/ext/Compress/Zlib/Zlib.pm index a831b4d..ea6e3ff 100644 --- a/ext/Compress/Zlib/Zlib.pm +++ b/ext/Compress/Zlib/Zlib.pm @@ -1,7 +1,7 @@ # File : Zlib.pm # Author : Paul Marquess -# Created : 30 January 2005 -# Version : 1.35 +# Created : 12 August 2005 +# Version : 1.37 # # Copyright (c) 1995-2005 Paul Marquess. All rights reserved. # This program is free software; you can redistribute it and/or @@ -21,7 +21,7 @@ use warnings ; our ($VERSION, @ISA, @EXPORT, $AUTOLOAD); our ($deflateDefault, $deflateParamsDefault, $inflateDefault); -$VERSION = "1.35" ; +$VERSION = "1.37" ; @ISA = qw(Exporter); # Items to export into callers namespace by default. Note: do not export @@ -877,7 +877,7 @@ compressed data. Otherwise it returns I. The source buffer can either be a scalar or a scalar reference. -The B<$level> parameter defines the compression level. Valid values are +The B<$level> paramter defines the compression level. Valid values are 0 through 9, C, C, C, and C. If B<$level> is not specified C will be used. @@ -1147,7 +1147,85 @@ The buffer parameters can either be a scalar or a scalar reference. If the $crc parameters is C, the crc value will be reset. -=head1 ACCESSING ZIP FILES +=head1 FAQ + +=head2 Compatibility with Unix compress/uncompress. + +Although C has a pair of functions called C +and C, they are I the same as the Unix programs of the +same name. The C library is not compatable with Unix +C. + +If you have the C program available, you can use this to +read compressed files + + open F, "uncompress -c $filename |"; + while () + { + ... + +If you have the C program available, you can use this to read +compressed files + + open F, "gunzip -c $filename |"; + while () + { + ... + +and this to write compress files if you have the C program +available + + open F, "| compress -c $filename "; + print F "data"; + ... + close F ; + +=head2 Accessing .tar.Z files + +The C module can optionally use C (via +the C module) to access tar files that have been compressed +with C. Unfortunately tar files compressed with the Unix C +utility cannot be read by C and so cannot be directly +accesses by C. + +If the C or C programs are available, you can use +one of these workarounds to read C<.tar.Z> files from C + +Firstly with C + + use strict; + use warnings; + use Archive::Tar; + + open F, "uncompress -c $filename |"; + my $tar = Archive::Tar->new(*F); + ... + +and this with C + + use strict; + use warnings; + use Archive::Tar; + + open F, "gunzip -c $filename |"; + my $tar = Archive::Tar->new(*F); + ... + +Similarly, if the C program is available, you can use this to +write a C<.tar.Z> file + + use strict; + use warnings; + use Archive::Tar; + use IO::File; + + my $fh = newIO::File "| compress -c >$filename"; + my $tar = Archive::Tar->new(); + ... + $tar->write($fh); + $fh->close ; + +=head2 Accessing ZIP Files Although it is possible to use this module to access .zip files, there is a module on CPAN that will do all the hard work for you. Check out diff --git a/ext/Compress/Zlib/t/03examples.t b/ext/Compress/Zlib/t/03examples.t index a8f6273..e48ec1b 100644 --- a/ext/Compress/Zlib/t/03examples.t +++ b/ext/Compress/Zlib/t/03examples.t @@ -40,18 +40,7 @@ sub readFile } -my $Inc = '' ; -if ($^O eq 'VMS') { - $Inc = '-"I[-.lib]" -"I[-.arch]"'; -} -elsif ($^O eq 'MSWin32') { - foreach (@INC) - { $Inc .= qq["-I$_" ]} -} -else { - foreach (@INC) - { $Inc .= "-I$_ " } -} +my $Inc = join " ", map qq["-I$_"] => @INC; my $Perl = '' ; $Perl = ($ENV{'FULLPERL'} or $^X or 'perl') ; @@ -171,4 +160,7 @@ ok(9, $a eq $hello1 . $hello2) ; } -unlink $file1, $file2, $stderr ; +END +{ + for ($file1, $file2, $stderr) { 1 while unlink $_ } ; +}