Hello community, here is the log from the commit of package perl-IO-All for openSUSE:Factory checked in at 2014-03-25 13:25:36 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-IO-All (Old) and /work/SRC/openSUSE:Factory/.perl-IO-All.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-IO-All" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-IO-All/perl-IO-All.changes 2014-03-10 12:42:54.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.perl-IO-All.new/perl-IO-All.changes 2014-03-25 13:25:38.000000000 +0100 @@ -1,0 +2,6 @@ +Sat Mar 22 19:05:19 UTC 2014 - [email protected] + +- updated to 0.60 + - Fix IO Layer situation (Thanks Mithaldu!) + +------------------------------------------------------------------- Old: ---- IO-All-0.59.tar.gz New: ---- IO-All-0.60.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-IO-All.spec ++++++ --- /var/tmp/diff_new_pack.I55NeT/_old 2014-03-25 13:25:38.000000000 +0100 +++ /var/tmp/diff_new_pack.I55NeT/_new 2014-03-25 13:25:38.000000000 +0100 @@ -17,7 +17,7 @@ Name: perl-IO-All -Version: 0.59 +Version: 0.60 Release: 0 %define cpan_name IO-All Summary: IO::All of it to Graham and Damian! ++++++ IO-All-0.59.tar.gz -> IO-All-0.60.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-All-0.59/Changes new/IO-All-0.60/Changes --- old/IO-All-0.59/Changes 2014-03-07 01:48:37.000000000 +0100 +++ new/IO-All-0.60/Changes 2014-03-22 04:50:35.000000000 +0100 @@ -1,4 +1,8 @@ --- +version: 0.60 +changes: +- Fix IO Layer situation (Thanks Mithaldu!) +--- version: 0.59 changes: - Fix possible infinite loop in t/accept.t (Thanks C. Wallace for complaining) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-All-0.59/META.json new/IO-All-0.60/META.json --- old/IO-All-0.59/META.json 2014-03-07 01:48:37.000000000 +0100 +++ new/IO-All-0.60/META.json 2014-03-22 04:50:35.000000000 +0100 @@ -48,6 +48,6 @@ "web" : "https://github.com/ingydotnet/io-all-pm" } }, - "version" : "0.59" + "version" : "0.60" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-All-0.59/META.yml new/IO-All-0.60/META.yml --- old/IO-All-0.59/META.yml 2014-03-07 01:48:37.000000000 +0100 +++ new/IO-All-0.60/META.yml 2014-03-22 04:50:35.000000000 +0100 @@ -23,4 +23,4 @@ bugtracker: https://github.com/ingydotnet/io-all-pm/issues homepage: https://github.com/ingydotnet/io-all-pm repository: https://github.com/ingydotnet/io-all-pm.git -version: '0.59' +version: '0.60' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-All-0.59/Makefile.PL new/IO-All-0.60/Makefile.PL --- old/IO-All-0.59/Makefile.PL 2014-03-07 01:48:37.000000000 +0100 +++ new/IO-All-0.60/Makefile.PL 2014-03-22 04:50:35.000000000 +0100 @@ -25,7 +25,7 @@ "Scalar::Util" => 0 }, "TEST_REQUIRES" => {}, - "VERSION" => "0.59", + "VERSION" => "0.60", "test" => { "TESTS" => "t/*.t" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-All-0.59/README new/IO-All-0.60/README --- old/IO-All-0.59/README 2014-03-07 01:48:37.000000000 +0100 +++ new/IO-All-0.60/README 2014-03-22 04:50:35.000000000 +0100 @@ -767,8 +767,8 @@ * binary - Indicates the file has binary content and should be opened with - "binmode". + Adds ":raw" to the list of PerlIO layers applied after "open", and + applies it immediately on an open handle. * chdir @@ -830,8 +830,8 @@ * utf8 - Indicates that IO should be done using utf8 encoding. Calls binmode - with ":utf8" layer. + Adds ":encoding(UTF-8)" to the list of PerlIO layers applied after + "open", and applies it immediately on an open handle. Configuration Methods The following methods don't do any actual I/O, but they set specific @@ -848,8 +848,9 @@ * binmode - Proxy for binmode. Requires a layer to be passed. Use "binary" for - plain binary mode. + Adds the specified layer to the list of PerlIO layers applied after + "open", and applies it immediately on an open handle. Does a bare + "binmode" when called without argument. * block_size @@ -886,7 +887,9 @@ * encoding - Set the encoding to be used for the PerlIO layer. + Adds the specified encoding to the list of PerlIO layers applied + after "open", and applies it immediately on an open handle. Requires + an argument. * errors diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-All-0.59/dist.ini new/IO-All-0.60/dist.ini --- old/IO-All-0.59/dist.ini 2014-03-07 01:48:37.000000000 +0100 +++ new/IO-All-0.60/dist.ini 2014-03-22 04:50:35.000000000 +0100 @@ -2,7 +2,7 @@ author = Ingy döt Net <[email protected]> license = Perl_5 copyright_holder = Ingy döt Net -version = 0.59 +version = 0.60 :version = 5.013 [NextRelease] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-All-0.59/lib/IO/All/Base.pm new/IO-All-0.60/lib/IO/All/Base.pm --- old/IO-All-0.59/lib/IO/All/Base.pm 2014-03-07 01:48:37.000000000 +0100 +++ new/IO-All-0.60/lib/IO/All/Base.pm 2014-03-22 04:50:35.000000000 +0100 @@ -1,5 +1,5 @@ package IO::All::Base; -$IO::All::Base::VERSION = '0.59'; +$IO::All::Base::VERSION = '0.60'; use strict; use warnings; use Fcntl; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-All-0.59/lib/IO/All/DBM.pm new/IO-All-0.60/lib/IO/All/DBM.pm --- old/IO-All-0.59/lib/IO/All/DBM.pm 2014-03-07 01:48:37.000000000 +0100 +++ new/IO-All-0.60/lib/IO/All/DBM.pm 2014-03-22 04:50:35.000000000 +0100 @@ -1,5 +1,5 @@ package IO::All::DBM; -$IO::All::DBM::VERSION = '0.59'; +$IO::All::DBM::VERSION = '0.60'; use strict; use warnings; use IO::All::File -base; @@ -77,7 +77,7 @@ @{$self->_dbm_extra} or $self->throw("Can't open '$filename' as DBM file:\n$!"); $self->add_utf8_dbm_filter($db) - if $self->_utf8; + if $self->_has_utf8; $self->tied_file($hash); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-All-0.59/lib/IO/All/Dir.pm new/IO-All-0.60/lib/IO/All/Dir.pm --- old/IO-All-0.59/lib/IO/All/Dir.pm 2014-03-07 01:48:37.000000000 +0100 +++ new/IO-All-0.60/lib/IO/All/Dir.pm 2014-03-22 04:50:35.000000000 +0100 @@ -1,5 +1,5 @@ package IO::All::Dir; -$IO::All::Dir::VERSION = '0.59'; +$IO::All::Dir::VERSION = '0.60'; use strict; use warnings; use Scalar::Util 'blessed'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-All-0.59/lib/IO/All/File.pm new/IO-All-0.60/lib/IO/All/File.pm --- old/IO-All-0.59/lib/IO/All/File.pm 2014-03-07 01:48:37.000000000 +0100 +++ new/IO-All-0.60/lib/IO/All/File.pm 2014-03-22 04:50:35.000000000 +0100 @@ -1,5 +1,5 @@ package IO::All::File; -$IO::All::File::VERSION = '0.59'; +$IO::All::File::VERSION = '0.60'; use strict; use warnings; use IO::All::Filesys -base; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-All-0.59/lib/IO/All/Filesys.pm new/IO-All-0.60/lib/IO/All/Filesys.pm --- old/IO-All-0.59/lib/IO/All/Filesys.pm 2014-03-07 01:48:37.000000000 +0100 +++ new/IO-All-0.60/lib/IO/All/Filesys.pm 2014-03-22 04:50:35.000000000 +0100 @@ -1,5 +1,5 @@ package IO::All::Filesys; -$IO::All::Filesys::VERSION = '0.59'; +$IO::All::Filesys::VERSION = '0.60'; use strict; use warnings; use IO::All::Base -base; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-All-0.59/lib/IO/All/Link.pm new/IO-All-0.60/lib/IO/All/Link.pm --- old/IO-All-0.59/lib/IO/All/Link.pm 2014-03-07 01:48:37.000000000 +0100 +++ new/IO-All-0.60/lib/IO/All/Link.pm 2014-03-22 04:50:35.000000000 +0100 @@ -1,5 +1,5 @@ package IO::All::Link; -$IO::All::Link::VERSION = '0.59'; +$IO::All::Link::VERSION = '0.60'; use strict; use warnings; use IO::All::File -base; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-All-0.59/lib/IO/All/MLDBM.pm new/IO-All-0.60/lib/IO/All/MLDBM.pm --- old/IO-All-0.59/lib/IO/All/MLDBM.pm 2014-03-07 01:48:37.000000000 +0100 +++ new/IO-All-0.60/lib/IO/All/MLDBM.pm 2014-03-22 04:50:35.000000000 +0100 @@ -1,5 +1,5 @@ package IO::All::MLDBM; -$IO::All::MLDBM::VERSION = '0.59'; +$IO::All::MLDBM::VERSION = '0.60'; use strict; use warnings; use IO::All::DBM -base; @@ -28,7 +28,7 @@ @{$self->_dbm_extra} or $self->throw("Can't open '$filename' as MLDBM file:\n$!"); $self->add_utf8_dbm_filter($db) - if $self->_utf8; + if $self->_has_utf8; $self->tied_file($hash); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-All-0.59/lib/IO/All/Pipe.pm new/IO-All-0.60/lib/IO/All/Pipe.pm --- old/IO-All-0.59/lib/IO/All/Pipe.pm 2014-03-07 01:48:37.000000000 +0100 +++ new/IO-All-0.60/lib/IO/All/Pipe.pm 2014-03-22 04:50:35.000000000 +0100 @@ -1,5 +1,5 @@ package IO::All::Pipe; -$IO::All::Pipe::VERSION = '0.59'; +$IO::All::Pipe::VERSION = '0.60'; use strict; use warnings; use IO::All -base; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-All-0.59/lib/IO/All/STDIO.pm new/IO-All-0.60/lib/IO/All/STDIO.pm --- old/IO-All-0.59/lib/IO/All/STDIO.pm 2014-03-07 01:48:37.000000000 +0100 +++ new/IO-All-0.60/lib/IO/All/STDIO.pm 2014-03-22 04:50:35.000000000 +0100 @@ -1,5 +1,5 @@ package IO::All::STDIO; -$IO::All::STDIO::VERSION = '0.59'; +$IO::All::STDIO::VERSION = '0.60'; use strict; use warnings; use IO::All -base; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-All-0.59/lib/IO/All/Socket.pm new/IO-All-0.60/lib/IO/All/Socket.pm --- old/IO-All-0.59/lib/IO/All/Socket.pm 2014-03-07 01:48:37.000000000 +0100 +++ new/IO-All-0.60/lib/IO/All/Socket.pm 2014-03-22 04:50:35.000000000 +0100 @@ -1,5 +1,5 @@ package IO::All::Socket; -$IO::All::Socket::VERSION = '0.59'; +$IO::All::Socket::VERSION = '0.60'; use strict; use warnings; use IO::All -base; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-All-0.59/lib/IO/All/String.pm new/IO-All-0.60/lib/IO/All/String.pm --- old/IO-All-0.59/lib/IO/All/String.pm 2014-03-07 01:48:37.000000000 +0100 +++ new/IO-All-0.60/lib/IO/All/String.pm 2014-03-22 04:50:35.000000000 +0100 @@ -1,5 +1,5 @@ package IO::All::String; -$IO::All::String::VERSION = '0.59'; +$IO::All::String::VERSION = '0.60'; use strict; use warnings; use IO::All -base; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-All-0.59/lib/IO/All/Temp.pm new/IO-All-0.60/lib/IO/All/Temp.pm --- old/IO-All-0.59/lib/IO/All/Temp.pm 2014-03-07 01:48:37.000000000 +0100 +++ new/IO-All-0.60/lib/IO/All/Temp.pm 2014-03-22 04:50:35.000000000 +0100 @@ -1,5 +1,5 @@ package IO::All::Temp; -$IO::All::Temp::VERSION = '0.59'; +$IO::All::Temp::VERSION = '0.60'; use strict; use warnings; use IO::All::File -base; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-All-0.59/lib/IO/All.pm new/IO-All-0.60/lib/IO/All.pm --- old/IO-All-0.59/lib/IO/All.pm 2014-03-07 01:48:37.000000000 +0100 +++ new/IO-All-0.60/lib/IO/All.pm 2014-03-22 04:50:35.000000000 +0100 @@ -1,5 +1,5 @@ package IO::All; -$IO::All::VERSION = '0.59'; +$IO::All::VERSION = '0.60'; use 5.006001; use strict; use warnings; @@ -316,11 +316,8 @@ # Private Accessors #=============================================================================== field 'package'; -field _binary => undef; -field _binmode => undef; field _strict => undef; -field _encoding => undef; -field _utf8 => undef; +field _layers => []; field _handle => undef; #=============================================================================== @@ -417,7 +414,7 @@ sub BINMODE { my $self = shift; - binmode *$self->io_handle; + CORE::binmode *$self->io_handle; } { @@ -541,25 +538,26 @@ sub binary { my $self = shift; - binmode($self->io_handle) - if $self->is_open; - $self->_binary(1); - $self->encoding(0); + CORE::binmode($self->io_handle) if $self->is_open; + push @{$self->_layers}, ":raw"; return $self; } sub binmode { my $self = shift; my $layer = shift; - if ($self->is_open) { - $layer - ? CORE::binmode($self->io_handle, $layer) - : CORE::binmode($self->io_handle); - } - $self->_binmode($layer); + $self->_sane_binmode($layer) if $self->is_open; + push @{$self->_layers}, $layer; return $self; } +sub _sane_binmode { + my ($self, $layer) = @_; + $layer + ? CORE::binmode($self->io_handle, $layer) + : CORE::binmode($self->io_handle); +} + sub buffer { my $self = shift; if (not @_) { @@ -727,25 +725,31 @@ if ($] < 5.008) { die "IO::All -utf8 not supported on Perl older than 5.8"; } - CORE::binmode($self->io_handle, ':encoding(UTF-8)') - if $self->is_open; - $self->_utf8(1); $self->encoding('UTF-8'); return $self; } +sub _has_utf8 { + grep { $_ eq ':encoding(UTF-8)' } @{shift->_layers} +} + sub encoding { my $self = shift; my $encoding = shift; if ($] < 5.008) { die "IO::All -encoding not supported on Perl older than 5.8"; } - CORE::binmode($self->io_handle, ":encoding($encoding)") - if $self->is_open and $encoding; - $self->_encoding($encoding); + die "No valid encoding string sent" if !$encoding; + $self->_set_encoding($encoding) if $self->is_open and $encoding; + push @{$self->_layers}, ":encoding($encoding)"; return $self; } +sub _set_encoding { + my ($self, $encoding) = @_; + return CORE::binmode($self->io_handle, ":encoding($encoding)"); +} + sub write { my $self = shift; $self->assert_open('>'); @@ -814,10 +818,7 @@ sub set_binmode { my $self = shift; - my $encoding = $self->_encoding; - CORE::binmode($self->io_handle, ":encoding($encoding)") if $encoding; - CORE::binmode($self->io_handle) if $self->_binary; - CORE::binmode($self->io_handle, $self->_binmode) if $self->_binmode; + $self->_sane_binmode($_) for @{$self->_layers}; return $self; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-All-0.59/lib/IO/All.pod new/IO-All-0.60/lib/IO/All.pod --- old/IO-All-0.59/lib/IO/All.pod 2014-03-07 01:48:37.000000000 +0100 +++ new/IO-All-0.60/lib/IO/All.pod 2014-03-22 04:50:35.000000000 +0100 @@ -788,8 +788,8 @@ =item * binary -Indicates the file has binary content and should be opened with -C<binmode>. +Adds C<:raw> to the list of PerlIO layers applied after C<open>, +and applies it immediately on an open handle. =item * chdir @@ -849,8 +849,8 @@ =item * utf8 -Indicates that IO should be done using utf8 encoding. Calls binmode with -C<:utf8> layer. +Adds C<:encoding(UTF-8)> to the list of PerlIO layers applied after C<open>, +and applies it immediately on an open handle. =back @@ -872,8 +872,9 @@ =item * binmode -Proxy for binmode. Requires a layer to be passed. Use C<binary> for -plain binary mode. +Adds the specified layer to the list of PerlIO layers applied after C<open>, +and applies it immediately on an open handle. Does a bare C<binmode> when called +without argument. =item * block_size @@ -910,7 +911,8 @@ =item * encoding -Set the encoding to be used for the PerlIO layer. +Adds the specified encoding to the list of PerlIO layers applied after C<open>, +and applies it immediately on an open handle. Requires an argument. =item * errors diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-All-0.59/t/binary_utf8.t new/IO-All-0.60/t/binary_utf8.t --- old/IO-All-0.59/t/binary_utf8.t 2014-03-07 01:48:37.000000000 +0100 +++ new/IO-All-0.60/t/binary_utf8.t 2014-03-22 04:50:35.000000000 +0100 @@ -1,8 +1,9 @@ use lib 't', 'lib'; use strict; use warnings; +use utf8; -use Test::More tests => 3; +use Test::More tests => 8; use IO::All; use IO_All_Test; @@ -18,4 +19,19 @@ io($f)->binary->utf8->print("\n"); is(-s $f, 1, "a filehandle marked binary should never mangle newlines"); +io($f)->open('>')->binary->encoding('UTF-8')->print("ö\n"); +is(-s $f, 3, ":raw and utf8 encoding work correctly if defined after opening fh"); + +io($f)->binary->encoding('UTF-8')->print("ö\n"); +is(-s $f, 3, ":raw and utf8 encoding work correctly if defined before opening fh"); + +io($f)->open('>')->binmode->encoding('UTF-8')->print("ö\n"); +is(-s $f, 3, "binmode functions correctly without args after opening it"); + +io($f)->encoding('UTF-8')->binmode->print("ö\n"); +is(-s $f, 2, "binmode functions correctly without args before opening it"); + +io($f)->binary->encoding('UTF-8')->binmode->print("ö\n"); +is(-s $f, 2, "binmode functions correctly without args before opening it"); + del_output_dir(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-All-0.59/t/import_flags.t new/IO-All-0.60/t/import_flags.t --- old/IO-All-0.59/t/import_flags.t 2014-03-07 01:48:37.000000000 +0100 +++ new/IO-All-0.60/t/import_flags.t 2014-03-22 04:50:35.000000000 +0100 @@ -36,19 +36,19 @@ my $io1 = One::io('xxx'); ok $io1->_strict, 'strict flag set on object 1'; -ok not($io1->_utf8), +ok not($io1->_has_utf8), 'utf8 flag not set on object 1'; my $io2 = Two::io('xxx'); ok not($io2->_strict), 'strict flag not set on object 2'; -ok $io2->_utf8, +ok $io2->_has_utf8, 'utf8 flag set on object 2'; my $io3 = Three::io('xxx'); ok $io3->_strict, 'strict flag set on object 3'; -ok $io3->_utf8, +ok $io3->_has_utf8, 'utf8 flag set on object 3'; eval "Four::io('xxx')"; @@ -60,7 +60,7 @@ 'catfile name is correct'; ok not($io2b->_strict), 'strict flag not set on object 2b (propagated from 2)'; -ok $io2b->_utf8, +ok $io2b->_has_utf8, 'utf8 flag set on object 2b (propagated from 2)'; my $io2c = Two::io('aaa')->curdir; @@ -68,7 +68,7 @@ # die Dumper \%{*$io2c}; ok not($io2c->_strict), 'strict flag not set on object 2c (propagated from 2)'; -ok $io2c->_utf8, +ok $io2c->_has_utf8, 'utf8 flag set on object 2c (propagated from 2)'; -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
