r28407 - in /branches/upstream/libipc-system-simple-perl/current: Changes MANIFEST META.yml lib/IPC/System/Simple.pm t/08_core.t t/14_uninitialised.t

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Fri Dec 19 19:59:15 UTC 2008


Author: gregoa
Date: Fri Dec 19 19:59:11 2008
New Revision: 28407

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=28407
Log:
[svn-upgrade] Integrating new upstream version, libipc-system-simple-perl (1.17)

Added:
    branches/upstream/libipc-system-simple-perl/current/t/14_uninitialised.t
Modified:
    branches/upstream/libipc-system-simple-perl/current/Changes
    branches/upstream/libipc-system-simple-perl/current/MANIFEST
    branches/upstream/libipc-system-simple-perl/current/META.yml
    branches/upstream/libipc-system-simple-perl/current/lib/IPC/System/Simple.pm
    branches/upstream/libipc-system-simple-perl/current/t/08_core.t

Modified: branches/upstream/libipc-system-simple-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libipc-system-simple-perl/current/Changes?rev=28407&op=diff
==============================================================================
--- branches/upstream/libipc-system-simple-perl/current/Changes (original)
+++ branches/upstream/libipc-system-simple-perl/current/Changes Fri Dec 19 19:59:11 2008
@@ -1,4 +1,34 @@
 Revision history for Perl extension IPC::System::Simple.
+
+1.17  Fri Dec 19 00:45:16 AUSEDT 2008
+        * TEST: Tests to ensure that passing undefined values to
+          systemx() do not produce malformed errors, but instead
+          well-formed errors.  Many thanks to Nadim Khemir for
+          spotting this.  RT #41149.
+
+        * BUGFIX: Workaround for a bug under Perl 5.10 where on
+          some platforms coredumps were not being reported in $?.
+          Many thanks to the Debian Perl folks for finding this,
+          particularly Gregor Herrmann.
+
+        * TEST: Better diagnostics from t/08_core.t.
+
+        * TEST: t/08_core.t now cleans up its core files after running.
+          Thanks to Gregor Herrmann for spotting this.
+
+        * TEST: t/08_core.t is now a main test, rather than an
+          author-only test.
+
+        * BUGFIX: Attempting to call an undefined command is now
+          a fatal error.
+
+        * VERSION: Since ISS is now very stable, and provides a
+          significantly improved interface to the default system()
+          command, the major version number has been incremented.
+
+          There are no incompatible changes with previous version.
+          The increment of the major version number is to indicate
+          stability only.
 
 0.16  Sun Sep 14 11:29:17 AUSEST 2008
         * DOCUMENTATION: Updated documentation on $EXITVAL to provide

Modified: branches/upstream/libipc-system-simple-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libipc-system-simple-perl/current/MANIFEST?rev=28407&op=diff
==============================================================================
--- branches/upstream/libipc-system-simple-perl/current/MANIFEST (original)
+++ branches/upstream/libipc-system-simple-perl/current/MANIFEST Fri Dec 19 19:59:11 2008
@@ -28,6 +28,7 @@
 t/11_newlines.t
 t/12_systemx.t
 t/13_exports.t
+t/14_uninitialised.t
 t/critic.t
 t/exiter.pl
 t/internal.t

Modified: branches/upstream/libipc-system-simple-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libipc-system-simple-perl/current/META.yml?rev=28407&op=diff
==============================================================================
--- branches/upstream/libipc-system-simple-perl/current/META.yml (original)
+++ branches/upstream/libipc-system-simple-perl/current/META.yml Fri Dec 19 19:59:11 2008
@@ -29,4 +29,4 @@
   bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=IPC-System-Simple
   license: http://dev.perl.org/licenses/
   repository: http://github.com/pfenwick/ipc-system-simple/tree/master
-version: 0.16
+version: 1.17

Modified: branches/upstream/libipc-system-simple-perl/current/lib/IPC/System/Simple.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libipc-system-simple-perl/current/lib/IPC/System/Simple.pm?rev=28407&op=diff
==============================================================================
--- branches/upstream/libipc-system-simple-perl/current/lib/IPC/System/Simple.pm (original)
+++ branches/upstream/libipc-system-simple-perl/current/lib/IPC/System/Simple.pm Fri Dec 19 19:59:11 2008
@@ -39,6 +39,8 @@
 use constant FAIL_SIGNAL    => q{"%s" died to signal "%s" (%d)%s};
 use constant FAIL_BADEXIT   => q{"%s" unexpectedly returned exit value %d};
 
+use constant FAIL_UNDEF     => q{%s called with undefined command};
+
 use constant FAIL_POSIX     => q{IPC::System::Simple does not understand the POSIX error '%s'.  Please check http://search.cpan.org/perldoc?IPC::System::Simple to see if there is an updated version.  If not please report this as a bug to http://rt.cpan.org/Public/Bug/Report.html?Queue=IPC-System-Simple};
 
 # On Perl's older than 5.8.x we can't assume that there'll be a
@@ -61,7 +63,7 @@
     $EXITVAL EXIT_ANY
 );
 
-our $VERSION = '0.16';
+our $VERSION = '1.17';
 our $EXITVAL = -1;
 
 my @Signal_from_number = split(' ', $Config{sig_name});
@@ -95,15 +97,26 @@
 # many systems define it.  Check the POSIX module in the hope that
 # it may actually be there.
 
+
+# TODO: Ideally, $NATIVE_WCOREDUMP should be a constant.
+
+my $NATIVE_WCOREDUMP;
+
 eval { POSIX::WCOREDUMP(1); };
 
 if ($@ =~ UNDEFINED_POSIX_RE) {
 	*WCOREDUMP = sub { $_[0] & 128 };
+        $NATIVE_WCOREDUMP = 0;
 } elsif ($@) {
 	croak sprintf FAIL_POSIX, $@;
 } else {
 	# POSIX actually has it defined!  Huzzah!
 	*WCOREDUMP = \&POSIX::WCOREDUMP;
+        $NATIVE_WCOREDUMP = 1;
+}
+
+sub _native_wcoredump {
+    return $NATIVE_WCOREDUMP;
 }
 
 # system simply calls run
@@ -469,6 +482,16 @@
 
 	my $coredump = WCOREDUMP($child_error);
 
+        # There's a bug in perl 5.10.0 where if the system
+        # does not provide a native WCOREDUMP, then $? will
+        # never contain coredump information.  This code
+        # checks to see if we have the bug, and works around
+        # it if needed.
+
+        if ($] >= 5.010 and not $NATIVE_WCOREDUMP) {
+            $coredump ||= WCOREDUMP( ${^CHILD_ERROR_NATIVE} );
+        }
+
 	if ($child_error == -1) {
 		croak sprintf(FAIL_START, $command, $!);
 
@@ -530,6 +553,10 @@
 	}
 
 	my $command = shift(@_);
+
+        if (not defined $command) {
+                croak sprintf( FAIL_UNDEF, $caller );
+        }
 
 	return ($valid_returns,$command, at _);
 
@@ -894,6 +921,12 @@
 If not, please file a bug report according to the L</Reporting bugs> section
 below.
 
+=item IPC::System::Simple::%s called with undefined command
+
+You've passed the undefined value as a command to be executed.
+While this is a very Zen-like action, it's not supported by
+Perl's current implementation.
+
 =back
 
 =head1 DEPENDENCIES

Modified: branches/upstream/libipc-system-simple-perl/current/t/08_core.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libipc-system-simple-perl/current/t/08_core.t?rev=28407&op=diff
==============================================================================
--- branches/upstream/libipc-system-simple-perl/current/t/08_core.t (original)
+++ branches/upstream/libipc-system-simple-perl/current/t/08_core.t Fri Dec 19 19:59:11 2008
@@ -6,15 +6,11 @@
 use constant SIGABRT => 6;
 
 BEGIN {
-	if (not $ENV{TEST_AUTHOR}) {
-		plan skip_all => 'Author test.  Set $ENV{TEST_AUTHOR} to true to run.'
-	} 
+    eval { require BSD::Resource; BSD::Resource->import() };
 
-	eval { require BSD::Resource; BSD::Resource->import() };
-
-	if ($@) {
-		plan skip_all => "BSD::Resource required for coredump tests";
-	} 
+    if ($@) {
+        plan skip_all => "BSD::Resource required for coredump tests";
+    } 
 }
 
 plan tests => 3;
@@ -41,6 +37,8 @@
 		run([1],$perl_path, 'signaler.pl', SIGABRT);
 	};
 
-	like($@, qr/died to signal/);
-	like($@, qr/dumped core/);
+	like($@, qr/died to signal/, "Signal caught,   \$? = $?");
+	like($@, qr/dumped core/,    "Coredump caught, \$? = $?");
+
+        unlink('core');     # Clean up our core file, if it exists.
 }

Added: branches/upstream/libipc-system-simple-perl/current/t/14_uninitialised.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libipc-system-simple-perl/current/t/14_uninitialised.t?rev=28407&op=file
==============================================================================
--- branches/upstream/libipc-system-simple-perl/current/t/14_uninitialised.t (added)
+++ branches/upstream/libipc-system-simple-perl/current/t/14_uninitialised.t Fri Dec 19 19:59:11 2008
@@ -1,0 +1,22 @@
+#!/usr/bin/perl -w
+use strict;
+use warnings;
+use Test::More;
+
+use IPC::System::Simple qw(systemx);
+
+eval "use Test::NoWarnings qw(had_no_warnings clear_warnings)";
+
+plan skip_all => "Test::NoWarnings required for testing undef warnings" if $@;
+
+plan 'no_plan';
+
+# Passing undef to system functions should produce a nice message,
+# not a warning and a malformed message.
+
+
+eval {
+    systemx(undef,1);
+};
+
+like($@, qr/undef/, "systemx() should check for undef");




More information about the Pkg-perl-cvs-commits mailing list