Hello community, here is the log from the commit of package perl-IO-Compress-Base checked in at Wed Mar 7 13:35:52 CET 2007. -------- --- perl-IO-Compress-Base/perl-IO-Compress-Base.changes 2007-02-26 14:21:39.000000000 +0100 +++ /mounts/work_src_done/STABLE/perl-IO-Compress-Base/perl-IO-Compress-Base.changes 2007-03-07 11:22:20.000000000 +0100 @@ -1,0 +2,6 @@ +Wed Mar 7 11:21:45 CET 2007 - anicka@suse.cz + +- update to 2.004 + * Made seek less wasteful of memory. + +------------------------------------------------------------------- Old: ---- IO-Compress-Base-2.003.tar.bz2 New: ---- IO-Compress-Base-2.004.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-IO-Compress-Base.spec ++++++ --- /var/tmp/diff_new_pack.P26500/_old 2007-03-07 11:37:45.000000000 +0100 +++ /var/tmp/diff_new_pack.P26500/_new 2007-03-07 11:37:45.000000000 +0100 @@ -1,5 +1,5 @@ # -# spec file for package perl-IO-Compress-Base (Version 2.003) +# spec file for package perl-IO-Compress-Base (Version 2.004) # # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -11,13 +11,13 @@ # norootforbuild Name: perl-IO-Compress-Base -URL: http://cpan.org/modules/by-module/Compress/ +URL: http://cpan.org/modules/by-module/IO/ License: Artistic License Group: Development/Libraries/Perl Requires: perl = %{perl_version} Autoreqprov: on Summary: Base Class for IO::Compress modules -Version: 2.003 +Version: 2.004 Release: 1 Source: IO-Compress-Base-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -65,5 +65,8 @@ /var/adm/perl-modules/perl-IO-Compress-Base %changelog +* Wed Mar 07 2007 - anicka@suse.cz +- update to 2.004 + * Made seek less wasteful of memory. * Mon Feb 26 2007 - anicka@suse.cz - package created (initial version 2.003) ++++++ IO-Compress-Base-2.003.tar.bz2 -> IO-Compress-Base-2.004.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/IO-Compress-Base-2.003/Changes new/IO-Compress-Base-2.004/Changes --- old/IO-Compress-Base-2.003/Changes 2007-01-02 11:17:51.000000000 +0100 +++ new/IO-Compress-Base-2.004/Changes 2007-03-03 16:17:47.000000000 +0100 @@ -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 diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/IO-Compress-Base-2.003/lib/IO/Compress/Base/Common.pm new/IO-Compress-Base-2.004/lib/IO/Compress/Base/Common.pm --- old/IO-Compress-Base-2.003/lib/IO/Compress/Base/Common.pm 2007-01-02 12:14:01.000000000 +0100 +++ new/IO-Compress-Base-2.004/lib/IO/Compress/Base/Common.pm 2007-03-03 16:20:15.000000000 +0100 @@ -9,15 +9,16 @@ 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_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} ')) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/IO-Compress-Base-2.003/lib/IO/Compress/Base.pm new/IO-Compress-Base-2.004/lib/IO/Compress/Base.pm --- old/IO-Compress-Base-2.003/lib/IO/Compress/Base.pm 2007-01-02 12:13:50.000000000 +0100 +++ new/IO-Compress-Base-2.004/lib/IO/Compress/Base.pm 2007-03-03 16:20:08.000000000 +0100 @@ -6,7 +6,7 @@ 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 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 @@ { # 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 @@ -# 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 @@ 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) ; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/IO-Compress-Base-2.003/lib/IO/Uncompress/AnyUncompress.pm new/IO-Compress-Base-2.004/lib/IO/Uncompress/AnyUncompress.pm --- old/IO-Compress-Base-2.003/lib/IO/Uncompress/AnyUncompress.pm 2007-01-02 12:13:58.000000000 +0100 +++ new/IO-Compress-Base-2.004/lib/IO/Uncompress/AnyUncompress.pm 2007-03-03 16:20:13.000000000 +0100 @@ -4,16 +4,16 @@ 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 @@ 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 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] ) ; } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/IO-Compress-Base-2.003/lib/IO/Uncompress/Base.pm new/IO-Compress-Base-2.004/lib/IO/Uncompress/Base.pm --- old/IO-Compress-Base-2.003/lib/IO/Uncompress/Base.pm 2007-01-02 12:13:50.000000000 +0100 +++ new/IO-Compress-Base-2.004/lib/IO/Uncompress/Base.pm 2007-03-03 16:20:08.000000000 +0100 @@ -10,12 +10,12 @@ @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 @@ '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 @@ *$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 @@ $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 @@ # 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 diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/IO-Compress-Base-2.003/Makefile.PL new/IO-Compress-Base-2.004/Makefile.PL --- old/IO-Compress-Base-2.003/Makefile.PL 2006-10-26 13:40:06.000000000 +0200 +++ new/IO-Compress-Base-2.004/Makefile.PL 2007-01-11 11:00:15.000000000 +0100 @@ -35,6 +35,9 @@ : () ), + ((ExtUtils::MakeMaker->VERSION() gt '6.30') ? + ('LICENSE' => 'perl') : ()), + ) ; # end of file Makefile.PL diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/IO-Compress-Base-2.003/META.yml new/IO-Compress-Base-2.004/META.yml --- old/IO-Compress-Base-2.003/META.yml 2007-01-02 12:16:00.000000000 +0100 +++ new/IO-Compress-Base-2.004/META.yml 2007-03-03 16:35:15.000000000 +0100 @@ -1,8 +1,8 @@ --- #YAML:1.0 name: IO-Compress-Base -version: 2.003 +version: 2.004 abstract: Base Class for IO::Compress modules -license: ~ +license: perl generated_by: ExtUtils::MakeMaker version 6.31 distribution_type: module requires: diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/IO-Compress-Base-2.003/README new/IO-Compress-Base-2.004/README --- old/IO-Compress-Base-2.003/README 2007-01-02 12:13:49.000000000 +0100 +++ new/IO-Compress-Base-2.004/README 2007-03-03 16:20:07.000000000 +0100 @@ -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. diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/IO-Compress-Base-2.003/t/compress/generic.pl new/IO-Compress-Base-2.004/t/compress/generic.pl --- old/IO-Compress-Base-2.003/t/compress/generic.pl 2007-01-02 11:23:51.000000000 +0100 +++ new/IO-Compress-Base-2.004/t/compress/generic.pl 2007-02-19 12:59:33.000000000 +0100 @@ -18,7 +18,7 @@ $extra = 1 if $st ; - plan(tests => 639 + $extra) ; + plan(tests => 641 + $extra) ; } sub myGZreadFile @@ -653,7 +653,9 @@ 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; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/IO-Compress-Base-2.003/t/compress/merge.pl new/IO-Compress-Base-2.004/t/compress/merge.pl --- old/IO-Compress-Base-2.003/t/compress/merge.pl 2007-01-02 11:23:51.000000000 +0100 +++ new/IO-Compress-Base-2.004/t/compress/merge.pl 2007-02-19 12:59:33.000000000 +0100 @@ -19,7 +19,7 @@ $extra = 1 if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 }; - plan tests => 166 + $extra ; + plan tests => 165 + $extra ; } @@ -32,13 +32,6 @@ 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 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org