r11528 - in /branches/upstream/libproc-fork-perl/current: Build.PL Changes MANIFEST META.yml lib/Proc/Fork.pm t/00.mock.t t/01.real.t t/cpants.t t/pod-coverage.t t/pod.t

gwolf at users.alioth.debian.org gwolf at users.alioth.debian.org
Sun Dec 23 18:21:56 UTC 2007


Author: gwolf
Date: Sun Dec 23 18:21:56 2007
New Revision: 11528

URL: http://svn.debian.org/wsvn/?sc=1&rev=11528
Log:
[svn-upgrade] Integrating new upstream version, libproc-fork-perl (0.6)

Added:
    branches/upstream/libproc-fork-perl/current/t/cpants.t
Removed:
    branches/upstream/libproc-fork-perl/current/t/pod-coverage.t
    branches/upstream/libproc-fork-perl/current/t/pod.t
Modified:
    branches/upstream/libproc-fork-perl/current/Build.PL
    branches/upstream/libproc-fork-perl/current/Changes
    branches/upstream/libproc-fork-perl/current/MANIFEST
    branches/upstream/libproc-fork-perl/current/META.yml
    branches/upstream/libproc-fork-perl/current/lib/Proc/Fork.pm
    branches/upstream/libproc-fork-perl/current/t/00.mock.t
    branches/upstream/libproc-fork-perl/current/t/01.real.t

Modified: branches/upstream/libproc-fork-perl/current/Build.PL
URL: http://svn.debian.org/wsvn/branches/upstream/libproc-fork-perl/current/Build.PL?rev=11528&op=diff
==============================================================================
--- branches/upstream/libproc-fork-perl/current/Build.PL (original)
+++ branches/upstream/libproc-fork-perl/current/Build.PL Sun Dec 23 18:21:56 2007
@@ -3,16 +3,12 @@
 use Module::Build;
 
 my $builder = Module::Build->new(
-    module_name         => 'Proc::Fork',
-    license             => 'perl',
-    dist_author         => 'Aristotle Pagaltzis <pagaltzis at gmx.de>',
-    dist_version_from   => 'lib/Proc/Fork.pm',
-    requires => { },
-	build_requires => {
-		'Test::More' => 0,
-	},
-    add_to_cleanup      => [ 'Proc-Fork-*' ],
-	create_makefile_pl => 'traditional',
+	module_name         => 'Proc::Fork',
+	license             => 'perl',
+	dist_author         => 'Aristotle Pagaltzis <pagaltzis at gmx.de>',
+	build_requires      => { 'Test::More' => 0 },
+	add_to_cleanup      => [ 'Proc-Fork-*' ],
+	create_makefile_pl  => 'traditional',
 );
 
 $builder->create_build_script();

Modified: branches/upstream/libproc-fork-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libproc-fork-perl/current/Changes?rev=11528&op=diff
==============================================================================
--- branches/upstream/libproc-fork-perl/current/Changes (original)
+++ branches/upstream/libproc-fork-perl/current/Changes Sun Dec 23 18:21:56 2007
@@ -1,40 +1,131 @@
-Revision history for Proc-Fork
+=head1 Revision history for Proc-Fork
 
-0.4   2007 Apr 01
-	- Simplify internals a bit, in hopes of fixing #17474 and #17926;
-	  unfortunately, no dice
 
-0.3   2006 May 10
-	- Add tests with real fork() call,
-	  with intent to resolve stalled bugs #17474 and #17926
-	- Add test for $pid getting passed to the parent block
+=head2 0.6 (2007-12-23 06:15:59+0100)
 
-0.2   2006 March 4
-	- Internals refactor to fix bugs #17474 and #17926
-	- Rejig tests, add a test for the syntax error catcher
+=over 4
 
-0.11  2005 October 3
-	- Add tests for POD and POD coverage
-	- Switch over to Module::Build
+=item * Get rid of the C<our> in the test suite so it works on pre-5.6 perls
 
-0.1   2005 April 23
-	- Minor documentation fix
-	- Complete internals refactor
-	- Add support and documentation for retry {}
-	- Create proper test suite
+=back
 
-0.05  2002 March 15
-	- Change namespace from Fork to Proc::Fork.
 
-0.04  2002 February 8
-	- Export parent, child, error by default.
-	- Add documentation examples.
+=head2 0.5 (2007-12-21 18:22:10+0100)
 
-0.03  2002 January 31
-	- Documentation changes only.
+Many thanks to David Golden for the Windows compat fixes.
 
-0.02  2002 January 30
-	- Bless the fork return value, for better error checking.
+=over 4
 
-0.01  2002 January 29
-	- original version
+=item * Windows compat: drop in-place modification of C<@_> and use of C<goto>
+
+=item * Windows compat: remove taint checking from tests to fix 
+
+=item * Only load L<Carp> on demand
+
+=item * Stop using of L<Exporter>
+
+=back
+
+
+=head2 0.4 (2007-04-01)
+
+=over 4
+
+=item * Simplify internals a bit, in hopes of fixing #17474 and #17926; unfortunately, no dice
+
+=back
+
+
+=head2 0.3 (2006-05-10)
+
+=over 4
+
+=item * Add tests with real fork() call, with intent to resolve stalled bugs #17474 and #17926
+
+=item * Add test for $pid getting passed to the parent block
+
+=back
+
+
+=head2 0.2 (2006-03-04)
+
+=over 4
+
+=item * Internals refactor to fix bugs #17474 and #17926
+
+=item * Rejig tests, add a test for the syntax error catcher
+
+=back
+
+
+=head2 0.11 (2005-10-03)
+
+=over 4
+
+=item * Add tests for POD and POD coverage
+
+=item * Switch over to Module::Build
+
+=back
+
+
+=head2 0.1 (2005-04-23)
+
+=over 4
+
+=item * Minor documentation fix
+
+=item * Complete internals refactor
+
+=item * Add support and documentation for retry {}
+
+=item * Create proper test suite
+
+=back
+
+
+=head2 0.05 (2002-03-15)
+
+=over 4
+
+=item * Change namespace from Fork to Proc::Fork.
+
+=back
+
+
+=head2 0.04 (2002-02-8)
+
+=over 4
+
+=item * Export parent, child, error by default.
+
+=item * Add documentation examples.
+
+=back
+
+
+=head2 0.03 (2002-01-31)
+
+=over 4
+
+=item * Documentation changes only.
+
+=back
+
+
+=head2 0.02 (2002-01-30)
+
+=over 4
+
+=item * Bless the fork return value, for better error checking.
+
+=back
+
+
+=head2 0.01 (2002-01-29)
+
+=over 4
+
+=item * original version
+
+=back

Modified: branches/upstream/libproc-fork-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/branches/upstream/libproc-fork-perl/current/MANIFEST?rev=11528&op=diff
==============================================================================
--- branches/upstream/libproc-fork-perl/current/MANIFEST (original)
+++ branches/upstream/libproc-fork-perl/current/MANIFEST Sun Dec 23 18:21:56 2007
@@ -3,9 +3,8 @@
 Build.PL
 t/00.mock.t
 t/01.real.t
-t/pod-coverage.t
-t/pod.t
 lib/Proc/Fork.pm
 MANIFEST
 META.yml
 Makefile.PL
+t/cpants.t

Modified: branches/upstream/libproc-fork-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libproc-fork-perl/current/META.yml?rev=11528&op=diff
==============================================================================
--- branches/upstream/libproc-fork-perl/current/META.yml (original)
+++ branches/upstream/libproc-fork-perl/current/META.yml Sun Dec 23 18:21:56 2007
@@ -1,6 +1,6 @@
 ---
 name: Proc-Fork
-version: 0.4
+version: 0.6
 author:
   - 'Aristotle Pagaltzis <pagaltzis at gmx.de>'
 abstract: 'Simple, intuitive interface to the fork() system call'
@@ -12,8 +12,8 @@
 provides:
   Proc::Fork:
     file: lib/Proc/Fork.pm
-    version: 0.4
-generated_by: Module::Build version 0.2805
+    version: 0.6
+generated_by: Module::Build version 0.2808
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.2.html
   version: 1.2

Modified: branches/upstream/libproc-fork-perl/current/lib/Proc/Fork.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libproc-fork-perl/current/lib/Proc/Fork.pm?rev=11528&op=diff
==============================================================================
--- branches/upstream/libproc-fork-perl/current/lib/Proc/Fork.pm (original)
+++ branches/upstream/libproc-fork-perl/current/lib/Proc/Fork.pm Sun Dec 23 18:21:56 2007
@@ -1,12 +1,85 @@
 #!/usr/bin/perl
 
+package Proc::Fork;
+
+$VERSION = 0.6; # also change it in the docs
+
+use strict;
+use warnings;
+
+my $make_forkblock = sub {
+	my ( $config_key ) = shift;
+
+	return sub (&;$) {
+		my ( $val, $config ) = @_;
+
+		# too many arguments or not a config hash as 2nd argument?
+		# then the user has almost certainly forgotten the trailing semicolon
+		if ( @_ > 2 or ( @_ == 2 and not eval { $config->isa( __PACKAGE__ ) } ) ) {
+			require Carp;
+			Carp::croak( "Syntax error (missing semicolon after $config_key clause?)" );
+		}
+
+		$config ||= bless {}, __PACKAGE__;
+		$config->{ $config_key } = $val;
+
+		# if not called in void context, then we're not the final part of the call
+		# chain, so just pass the config up the chain
+		return $config if defined wantarray;
+
+		# otherwise, we pull the trigger
+		my ( $p, $c, $e, $r ) = delete @{ $config }{ qw( parent child error retry ) };
+
+		my $pid;
+
+		{
+			my $retry;
+
+			do {
+				$pid = fork;
+			} while ( not defined $pid ) and ( $r and $r->( ++$retry ) );
+		}
+
+		if    ( not defined $pid ) { $e ? $e->()       : die "Cannot fork: $!\n" }
+		elsif ( $pid )             { $p ? $p->( $pid ) : 0 }
+		else                       { $c ? $c->()       : 0 }
+
+		return;
+	};
+};
+
+my %block = map { $_ => $make_forkblock->( $_ ) } qw( child error retry parent );
+
+sub import {
+	my $class = shift;
+	my $pkg = caller;
+
+	@_ = keys %block if not @_;
+
+	for my $name ( @_ ) {
+		if ( not exists $block{ $name } ) {
+			require Carp;
+			Carp::croak( qq{"$name" is not exported by the $class module} );
+		}
+
+		no strict;
+		*{ $pkg . '::' . $name } = $block{ $name };
+	}
+
+	return 1;
+}
+
+__PACKAGE__->import;
+
+__END__
+
 =head1 NAME
 
 Proc::Fork - Simple, intuitive interface to the fork() system call
 
 =head1 VERSION
 
-This documentation describes Proc::Fork version 0.4
+This documentation describes Proc::Fork version 0.6
 
 =head1 SYNOPSIS
 
@@ -251,75 +324,3 @@
 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
 
 =cut
-
-package Proc::Fork;
-
-$VERSION   = 0.4; # also change it in the docs
- at ISA       = qw( Exporter );
- at EXPORT    = qw( parent child error retry );
- at EXPORT_OK = qw();
-
-use strict;
-use warnings;
-
-use Exporter;
-use Carp;
-
-sub _do_fork {
-	my ( $p, $c, $e, $r ) = @_;
-
-	my ( $pid, $retry );
-	{
-		$pid = fork;
-		redo if not defined( $pid ) and $r and $r->( ++$retry );
-	}
-
-	if ( not defined $pid ) {
-		die "Cannot fork: $!\n" if not $e;
-		$e->();
-	}
-	elsif ( $pid ) {
-		$p->( $pid ) if $p;
-	}
-	else {
-		$c->() if $c;
-	}
-
-	return;
-}
-
-BEGIN {
-
-	my %glob = (
-		child  => \*child,
-		error  => \*error,
-		retry  => \*retry,
-		parent => \*parent,
-	);
-
-	for my $key ( keys %glob ) {
-		*{ $glob{ $key } } = sub (&;$) {
-			my ( $val, $config ) = @_;
-
-			# too many arguments or not a config hash as 2nd argument?
-			# then the user has almost certainly forgotten the trailing semicolon
-			croak "Syntax error (missing semicolon after $key clause?)"
-				if @_ > 2
-				or ( @_ == 2 and not eval { $config->isa( __PACKAGE__ ) } );
-
-			$config ||= bless {}, __PACKAGE__;
-			$config->{ $key } = $val;
-
-			# if not called in void context, then we're not the final part of the call
-			# chain, so just pass the config up the chain
-			return $config if defined wantarray;
-
-			# otherwise, pull the trigger
-			@_ = @{ $config }{ qw( parent child error retry ) };
-			undef $config;
-			goto &_do_fork;
-		};
-	}
-}
-
-!!"In simplicity lies beauty.";

Modified: branches/upstream/libproc-fork-perl/current/t/00.mock.t
URL: http://svn.debian.org/wsvn/branches/upstream/libproc-fork-perl/current/t/00.mock.t?rev=11528&op=diff
==============================================================================
--- branches/upstream/libproc-fork-perl/current/t/00.mock.t (original)
+++ branches/upstream/libproc-fork-perl/current/t/00.mock.t Sun Dec 23 18:21:56 2007
@@ -1,10 +1,9 @@
-#!perl -T
+#!perl
 use strict;
 use warnings;
+use vars '$forkres';
 
 use Test::More tests => 14;
-
-our $forkres;
 
 BEGIN { *CORE::GLOBAL::fork = sub { $forkres } }
 

Modified: branches/upstream/libproc-fork-perl/current/t/01.real.t
URL: http://svn.debian.org/wsvn/branches/upstream/libproc-fork-perl/current/t/01.real.t?rev=11528&op=diff
==============================================================================
--- branches/upstream/libproc-fork-perl/current/t/01.real.t (original)
+++ branches/upstream/libproc-fork-perl/current/t/01.real.t Sun Dec 23 18:21:56 2007
@@ -1,4 +1,4 @@
-#!perl -T
+#!perl
 use strict;
 use warnings;
 

Added: branches/upstream/libproc-fork-perl/current/t/cpants.t
URL: http://svn.debian.org/wsvn/branches/upstream/libproc-fork-perl/current/t/cpants.t?rev=11528&op=file
==============================================================================
--- branches/upstream/libproc-fork-perl/current/t/cpants.t (added)
+++ branches/upstream/libproc-fork-perl/current/t/cpants.t Sun Dec 23 18:21:56 2007
@@ -1,0 +1,4 @@
+#!perl
+use Test::More skip_all => 'This is just to fob CPANTS';
+eval 'use Test::Pod::Coverage';
+eval 'use Test::Pod';




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