r5991 - in /packages/libcompress-zlib-perl/branches/upstream/current: Changes META.yml Makefile.PL README lib/Compress/Zlib.pm t/000prereq.t t/08encoding.t
dmn at users.alioth.debian.org
dmn at users.alioth.debian.org
Fri Jul 27 04:06:06 UTC 2007
Author: dmn
Date: Fri Jul 27 04:06:06 2007
New Revision: 5991
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=5991
Log:
[svn-upgrade] Integrating new upstream version, libcompress-zlib-perl (2.005)
Modified:
packages/libcompress-zlib-perl/branches/upstream/current/Changes
packages/libcompress-zlib-perl/branches/upstream/current/META.yml
packages/libcompress-zlib-perl/branches/upstream/current/Makefile.PL
packages/libcompress-zlib-perl/branches/upstream/current/README
packages/libcompress-zlib-perl/branches/upstream/current/lib/Compress/Zlib.pm
packages/libcompress-zlib-perl/branches/upstream/current/t/000prereq.t
packages/libcompress-zlib-perl/branches/upstream/current/t/08encoding.t
Modified: packages/libcompress-zlib-perl/branches/upstream/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libcompress-zlib-perl/branches/upstream/current/Changes?rev=5991&op=diff
==============================================================================
--- packages/libcompress-zlib-perl/branches/upstream/current/Changes (original)
+++ packages/libcompress-zlib-perl/branches/upstream/current/Changes Fri Jul 27 04:06:06 2007
@@ -1,5 +1,10 @@
CHANGES
-------
+
+ 2.005 18 June 2007
+
+ * Added info about removing Compress::Zlib version 1, before
+ installing version 2.
2.004 3 March 2007
Modified: packages/libcompress-zlib-perl/branches/upstream/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libcompress-zlib-perl/branches/upstream/current/META.yml?rev=5991&op=diff
==============================================================================
--- packages/libcompress-zlib-perl/branches/upstream/current/META.yml (original)
+++ packages/libcompress-zlib-perl/branches/upstream/current/META.yml Fri Jul 27 04:06:06 2007
@@ -1,18 +1,18 @@
--- #YAML:1.0
name: Compress-Zlib
-version: 2.004
+version: 2.005
abstract: Interface to zlib compression library
license: perl
-generated_by: ExtUtils::MakeMaker version 6.31
+generated_by: ExtUtils::MakeMaker version 6.33
distribution_type: module
requires:
- Compress::Raw::Zlib: 2.004
- IO::Compress::Base: 2.004
- IO::Compress::Base::Common: 2.004
- IO::Compress::Gzip: 2.004
- IO::Compress::Gzip::Constants: 2.004
- IO::Uncompress::Base: 2.004
- IO::Uncompress::Gunzip: 2.004
+ Compress::Raw::Zlib: 2.005
+ IO::Compress::Base: 2.005
+ IO::Compress::Base::Common: 2.005
+ IO::Compress::Gzip: 2.005
+ IO::Compress::Gzip::Constants: 2.005
+ IO::Uncompress::Base: 2.005
+ IO::Uncompress::Gunzip: 2.005
Scalar::Util: 0
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.2.html
Modified: packages/libcompress-zlib-perl/branches/upstream/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libcompress-zlib-perl/branches/upstream/current/Makefile.PL?rev=5991&op=diff
==============================================================================
--- packages/libcompress-zlib-perl/branches/upstream/current/Makefile.PL (original)
+++ packages/libcompress-zlib-perl/branches/upstream/current/Makefile.PL Fri Jul 27 04:06:06 2007
@@ -3,10 +3,11 @@
use strict ;
require 5.004 ;
-$::VERSION = '2.004' ;
+$::VERSION = '2.005' ;
use private::MakeUtil;
use ExtUtils::MakeMaker 5.16 ;
+
UpDowngrade(getPerlFiles('MANIFEST'))
unless $ENV{PERL_CORE};
@@ -47,5 +48,26 @@
) ;
+# Check for Compress::Zlib version 1.
+eval "require Compress::Zlib; " ;
+if ( ! $ENV{PERL_CORE} && ! $@ && $Compress::Zlib::VERSION < 2)
+{
+ my $ver = $Compress::Zlib::VERSION ;
+ print <<EOM
+
+I see you already have Compress::Zlib version $ver installed.
+Version 1 MUST be removed for version 2 to operate correctly.
+
+The easiest way to do that is to install Compress::Zlib like this
+
+ make install UNINST=1
+
+If you run the CPAN shell run this before installing Compress::Zlib
+
+ o conf make_install_arg UNINST=1
+
+EOM
+}
+
# end of file Makefile.PL
Modified: packages/libcompress-zlib-perl/branches/upstream/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libcompress-zlib-perl/branches/upstream/current/README?rev=5991&op=diff
==============================================================================
--- packages/libcompress-zlib-perl/branches/upstream/current/README (original)
+++ packages/libcompress-zlib-perl/branches/upstream/current/README Fri Jul 27 04:06:06 2007
@@ -1,9 +1,9 @@
Compress::Zlib
- Version 2.004
+ Version 2.005
- 3rd March 2007
+ 18th June 2007
Copyright (c) 1995-2007 Paul Marquess. All rights reserved.
Modified: packages/libcompress-zlib-perl/branches/upstream/current/lib/Compress/Zlib.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libcompress-zlib-perl/branches/upstream/current/lib/Compress/Zlib.pm?rev=5991&op=diff
==============================================================================
--- packages/libcompress-zlib-perl/branches/upstream/current/lib/Compress/Zlib.pm (original)
+++ packages/libcompress-zlib-perl/branches/upstream/current/lib/Compress/Zlib.pm Fri Jul 27 04:06:06 2007
@@ -8,17 +8,17 @@
use IO::Handle ;
use Scalar::Util qw(dualvar);
-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 IO::Compress::Base::Common 2.005 ;
+use Compress::Raw::Zlib 2.005 ;
+use IO::Compress::Gzip 2.005 ;
+use IO::Uncompress::Gunzip 2.005 ;
use strict ;
use warnings ;
use bytes ;
our ($VERSION, $XS_VERSION, @ISA, @EXPORT, $AUTOLOAD);
-$VERSION = '2.004';
+$VERSION = '2.005';
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
@@ -193,6 +193,9 @@
return _set_gzerr(Z_STREAM_ERROR())
if $self->[1] ne 'deflate';
+ $] >= 5.008 and (utf8::downgrade($_[0], 1)
+ or croak "Wide character in gzwrite");
+
my $status = $gz->write($_[0]) ;
_save_gzerr($gz);
return $status ;
@@ -301,6 +304,9 @@
$in = \$_[0] ;
}
+ $] >= 5.008 and (utf8::downgrade($$in, 1)
+ or croak "Wide character in compress");
+
my $level = (@_ == 2 ? $_[1] : Z_DEFAULT_COMPRESSION() );
$x = new Compress::Raw::Zlib::Deflate -AppendOutput => 1, -Level => $level
@@ -327,6 +333,9 @@
else {
$in = \$_[0] ;
}
+
+ $] >= 5.008 and (utf8::downgrade($$in, 1)
+ or croak "Wide character in uncompress");
$x = new Compress::Raw::Zlib::Inflate -ConsumeInput => 0 or return undef ;
@@ -438,7 +447,7 @@
package Compress::Zlib ;
-use IO::Compress::Gzip::Constants 2.004 ;
+use IO::Compress::Gzip::Constants 2.005 ;
sub memGzip($)
{
@@ -446,6 +455,9 @@
# if the deflation buffer isn't a reference, make it one
my $string = (ref $_[0] ? $_[0] : \$_[0]) ;
+
+ $] >= 5.008 and (utf8::downgrade($$string, 1)
+ or croak "Wide character in memGzip");
IO::Compress::Gzip::gzip($string, \$out, Minimal => 1)
or return undef ;
@@ -518,6 +530,9 @@
# if the buffer isn't a reference, make it one
my $string = (ref $_[0] ? $_[0] : \$_[0]);
+ $] >= 5.008 and (utf8::downgrade($$string, 1)
+ or croak "Wide character in memGunzip");
+
_removeGzipHeader($string) == Z_OK()
or return undef;
@@ -1443,3 +1458,4 @@
+
Modified: packages/libcompress-zlib-perl/branches/upstream/current/t/000prereq.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libcompress-zlib-perl/branches/upstream/current/t/000prereq.t?rev=5991&op=diff
==============================================================================
--- packages/libcompress-zlib-perl/branches/upstream/current/t/000prereq.t (original)
+++ packages/libcompress-zlib-perl/branches/upstream/current/t/000prereq.t Fri Jul 27 04:06:06 2007
@@ -27,7 +27,7 @@
if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 };
- my $VERSION = '2.004';
+ my $VERSION = '2.005';
my @NAMES = qw(
Compress::Raw::Zlib
IO::Compress::Base
Modified: packages/libcompress-zlib-perl/branches/upstream/current/t/08encoding.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libcompress-zlib-perl/branches/upstream/current/t/08encoding.t?rev=5991&op=diff
==============================================================================
--- packages/libcompress-zlib-perl/branches/upstream/current/t/08encoding.t (original)
+++ packages/libcompress-zlib-perl/branches/upstream/current/t/08encoding.t Fri Jul 27 04:06:06 2007
@@ -28,7 +28,7 @@
$extra = 1
if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 };
- plan tests => 16 + $extra ;
+ plan tests => 29 + $extra ;
use_ok('Compress::Zlib', 2);
}
@@ -40,19 +40,6 @@
is Compress::Zlib::zlib_version, ZLIB_VERSION,
"ZLIB_VERSION matches Compress::Zlib::zlib_version" ;
-
-if(0)
-{
- # length of this string is 2 characters
- my $s = "\x{df}\x{100}";
-
- my $cs = Compress::Zlib::memGzip($s);
-
- # length stored at end of gzip file should be 4
- my ($crc, $len) = unpack ("VV", substr($cs, -8, 8));
-
- is $len, 4, "length is 4";
-}
{
title "memGzip" ;
@@ -68,28 +55,37 @@
}
{
+ title "memGunzip when compressed gzip has been encoded" ;
+ my $s = "hello world" ;
+
+ my $co = Compress::Zlib::memGzip($s);
+ is Compress::Zlib::memGunzip(my $x = $co), $s, " match uncompressed";
+
+ utf8::upgrade($co);
+
+ my $un = Compress::Zlib::memGunzip($co);
+ ok $un, " got uncompressed";
+
+ is $un, $s, " uncompressed matched original";
+}
+
+{
title "compress/uncompress";
my $s = "\x{df}\x{100}";
my $s_copy = $s ;
- #my $cs = compress($s);
my $ces = compress(Encode::encode_utf8($s_copy));
ok $ces, " compressed ok" ;
- #is $s, $ces ;
-
- #my $un = uncompress($cs);
- #is $un, $s;
-
my $un = Encode::decode_utf8(uncompress($ces));
- #my $un = uncompress($ces);
is $un, $s, " decode_utf8 ok";
- #$un = Encode::decode_utf8(uncompress($cs));
- #is $un, $s;
-
+ utf8::upgrade($ces);
+ $un = Encode::decode_utf8(uncompress($ces));
+ is $un, $s, " decode_utf8 ok";
+
}
{
@@ -116,5 +112,28 @@
is $s, Encode::decode_utf8($uncomp), " decode_utf8 ok" ;
}
-# Add tests that check that the module traps use of wide chars
+{
+ title "Catch wide characters";
+ my $a = "a\xFF\x{100}";
+ eval { Compress::Zlib::memGzip($a) };
+ like($@, qr/Wide character in memGzip/, " wide characters in memGzip");
+
+ eval { Compress::Zlib::memGunzip($a) };
+ like($@, qr/Wide character in memGunzip/, " wide characters in memGunzip");
+
+ eval { Compress::Zlib::compress($a) };
+ like($@, qr/Wide character in compress/, " wide characters in compress");
+
+ eval { Compress::Zlib::uncompress($a) };
+ like($@, qr/Wide character in uncompress/, " wide characters in uncompress");
+
+ my $lex = new LexFile my $name ;
+ ok my $fil = gzopen($name, "wb"), " gzopen for write ok" ;
+
+ eval { $fil->gzwrite($a); } ;
+ like($@, qr/Wide character in gzwrite/, " wide characters in gzwrite");
+
+ ok ! $fil->gzclose, " gzclose ok" ;
+}
+
More information about the Pkg-perl-cvs-commits
mailing list