Hello community, here is the log from the commit of package perl-File-Slurp for openSUSE:Factory checked in at Mon Jun 20 12:51:45 CEST 2011.
-------- --- perl-File-Slurp/perl-File-Slurp.changes 2011-05-17 12:22:40.000000000 +0200 +++ /mounts/work_src_done/STABLE/perl-File-Slurp/perl-File-Slurp.changes 2011-06-08 07:09:57.000000000 +0200 @@ -1,0 +2,8 @@ +Wed Jun 08 05:07:11 UTC 2011 - [email protected] + +- update to 9999.19: + * read_file and write_file work even when interrupted by signals; this + includes a test for read_file interrupt + * fixed bugs in the config synopsis example + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- File-Slurp-9999.18.tar.gz New: ---- File-Slurp-9999.19.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-File-Slurp.spec ++++++ --- /var/tmp/diff_new_pack.gEJqMN/_old 2011-06-20 11:49:47.000000000 +0200 +++ /var/tmp/diff_new_pack.gEJqMN/_new 2011-06-20 11:49:47.000000000 +0200 @@ -18,7 +18,7 @@ Name: perl-File-Slurp -Version: 9999.18 +Version: 9999.19 Release: 1 License: GPL+ or Artistic %define cpan_name File-Slurp ++++++ File-Slurp-9999.18.tar.gz -> File-Slurp-9999.19.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/File-Slurp-9999.18/Changes new/File-Slurp-9999.19/Changes --- old/File-Slurp-9999.18/Changes 2011-05-13 08:46:56.000000000 +0200 +++ new/File-Slurp-9999.19/Changes 2011-06-07 10:06:13.000000000 +0200 @@ -1,6 +1,14 @@ Revision history File::Slurp -9999.17 Fri May 13 02:30:05 EDT 2011 +9999.19 Tue Jun 7 04:06:06 EDT 2011 + - Fixed use line in t/edit_file.t to import :edit first + Thanks to paul + - read_file and write_file work even when interrupted by signals + this includes a test for read_file interrupt + Thanks to Andrew Danforth + - Fixed bugs in the config synopsis example + +9999.18 Fri May 13 02:30:05 EDT 2011 - Added :std and :edit export tags - Cleaned up EXPORT vars - Documented importing edit_file and edit_file_lines diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/File-Slurp-9999.18/MANIFEST new/File-Slurp-9999.19/MANIFEST --- old/File-Slurp-9999.18/MANIFEST 2011-05-05 07:29:59.000000000 +0200 +++ new/File-Slurp-9999.19/MANIFEST 2011-05-24 07:16:12.000000000 +0200 @@ -27,6 +27,7 @@ t/prepend_file.t t/pseudo.t t/read_dir.t +t/signal.t t/slurp.t t/stdin.t t/stringify.t diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/File-Slurp-9999.18/META.yml new/File-Slurp-9999.19/META.yml --- old/File-Slurp-9999.18/META.yml 2011-05-13 09:01:41.000000000 +0200 +++ new/File-Slurp-9999.19/META.yml 2011-06-07 10:06:16.000000000 +0200 @@ -1,6 +1,6 @@ --- #YAML:1.0 name: File-Slurp -version: 9999.18 +version: 9999.19 abstract: Simple and Efficient Reading/Writing/Modifying of Complete Files license: perl author: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/File-Slurp-9999.18/lib/File/Slurp.pm new/File-Slurp-9999.19/lib/File/Slurp.pm --- old/File-Slurp-9999.18/lib/File/Slurp.pm 2011-05-13 08:44:09.000000000 +0200 +++ new/File-Slurp-9999.19/lib/File/Slurp.pm 2011-05-30 21:58:53.000000000 +0200 @@ -9,12 +9,13 @@ use Exporter ; use Fcntl qw( :DEFAULT ) ; use POSIX qw( :fcntl_h ) ; +use Errno ; #use Symbol ; use vars qw( @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $VERSION ) ; @ISA = qw( Exporter ) ; -$VERSION = '9999.18'; +$VERSION = '9999.19'; my @std_export = qw( read_file @@ -223,6 +224,11 @@ my $read_cnt = sysread( $read_fh, ${$buf_ref}, $size_left, length ${$buf_ref} ) ; +# since we're using sysread Perl won't automatically restart the call +# when interrupted by a signal. + + next if $!{EINTR}; + unless ( defined $read_cnt ) { @_ = ( $opts, "read_file '$file_name' - loop sysread: $!"); @@ -500,6 +506,11 @@ my $write_cnt = syswrite( $write_fh, ${$buf_ref}, $size_left, $offset ) ; +# since we're using syswrite Perl won't automatically restart the call +# when interrupted by a signal. + + next if $!{EINTR}; + unless ( defined $write_cnt ) { @_ = ( $opts, "write_file '$file_name' - syswrite: $!"); @@ -821,8 +832,8 @@ # Here is a simple and fast way to load and save a simple config file # made of key=value lines. - my %conf = read_file( $file_name ) =~ /^(\w+)=(\.*)$/mg ; - write_file( $file_name, {atomic => 1}, map "$_=$conf{$_}\n", keys %conf ; + my %conf = read_file( $file_name ) =~ /^(\w+)=(.*)$/mg ; + write_file( $file_name, {atomic => 1}, map "$_=$conf{$_}\n", keys %conf ) ; # insert text at the beginning of a file prepend_file( 'filename', $text ) ; @@ -1169,7 +1180,7 @@ edit_file \&replace_foo, 'filename' ; sub replace_foo { s/foo/bar/g } - perl -pi -e '$_ = '' if /foo/' filename + perl -pi -e '$_ = "" if /foo/' filename use File::Slurp qw( edit_file_lines ) ; use File::Slurp ; edit_file_lines { $_ = '' if /foo/ } 'filename' ; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/File-Slurp-9999.18/t/edit_file.t new/File-Slurp-9999.19/t/edit_file.t --- old/File-Slurp-9999.18/t/edit_file.t 2011-05-13 08:46:37.000000000 +0200 +++ new/File-Slurp-9999.19/t/edit_file.t 2011-05-21 10:01:32.000000000 +0200 @@ -4,7 +4,7 @@ use lib qw(t) ; -use File::Slurp qw( read_file write_file :edit ) ; +use File::Slurp qw( :edit read_file write_file ) ; use Test::More ; use TestDriver ; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/File-Slurp-9999.18/t/inode.t new/File-Slurp-9999.19/t/inode.t --- old/File-Slurp-9999.18/t/inode.t 2009-05-01 02:20:30.000000000 +0200 +++ new/File-Slurp-9999.19/t/inode.t 2011-05-25 05:50:13.000000000 +0200 @@ -9,16 +9,13 @@ use Symbol ; use Test::More ; - -BEGIN{ - +BEGIN { if( $^O =~ '32' ) { plan skip_all => 'skip inode test on windows'; exit ; } - else { - plan tests => 2 ; - } + + plan tests => 2 ; } my $data = <<TEXT ; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/File-Slurp-9999.18/t/signal.t new/File-Slurp-9999.19/t/signal.t --- old/File-Slurp-9999.18/t/signal.t 1970-01-01 01:00:00.000000000 +0100 +++ new/File-Slurp-9999.19/t/signal.t 2011-06-07 10:05:31.000000000 +0200 @@ -0,0 +1,34 @@ +#!/usr/local/bin/perl -w + +use strict ; +use File::Slurp qw(read_file); + +use Carp ; +use Test::More ; + +BEGIN { + if( $^O =~ '32' ) { + plan skip_all => 'skip signal test on windows'; + exit ; + } + + plan tests => 1 ; +} + +$SIG{CHLD} = sub {}; + +pipe(IN, OUT); + +print "forking\n"; +if (!fork) { + sleep 1; + exit; +} +if (!fork) { + sleep 2; + print OUT "success"; + exit; +} +close OUT; +my $data = read_file(\*IN); +is ($data, "success", "handle EINTR failed"); ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
