r52331 - in /branches/upstream/libautodie-perl/current: ./ inc/Module/ inc/Module/Install/ lib/ lib/autodie/ lib/autodie/exception/ t/

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Mon Feb 8 22:14:48 UTC 2010


Author: jawnsy-guest
Date: Mon Feb  8 22:14:41 2010
New Revision: 52331

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=52331
Log:
[svn-upgrade] Integrating new upstream version, libautodie-perl (2.08)

Added:
    branches/upstream/libautodie-perl/current/t/eval_error.t   (with props)
Modified:
    branches/upstream/libautodie-perl/current/AUTHORS
    branches/upstream/libautodie-perl/current/Changes
    branches/upstream/libautodie-perl/current/MANIFEST
    branches/upstream/libautodie-perl/current/META.yml
    branches/upstream/libautodie-perl/current/inc/Module/Install.pm
    branches/upstream/libautodie-perl/current/inc/Module/Install/Base.pm
    branches/upstream/libautodie-perl/current/inc/Module/Install/Can.pm
    branches/upstream/libautodie-perl/current/inc/Module/Install/Fetch.pm
    branches/upstream/libautodie-perl/current/inc/Module/Install/Makefile.pm
    branches/upstream/libautodie-perl/current/inc/Module/Install/Metadata.pm
    branches/upstream/libautodie-perl/current/inc/Module/Install/Win32.pm
    branches/upstream/libautodie-perl/current/inc/Module/Install/WriteAll.pm
    branches/upstream/libautodie-perl/current/lib/Fatal.pm
    branches/upstream/libautodie-perl/current/lib/autodie.pm
    branches/upstream/libautodie-perl/current/lib/autodie/exception.pm
    branches/upstream/libautodie-perl/current/lib/autodie/exception/system.pm
    branches/upstream/libautodie-perl/current/lib/autodie/hints.pm
    branches/upstream/libautodie-perl/current/t/flock.t
    branches/upstream/libautodie-perl/current/t/internal-backcompat.t
    branches/upstream/libautodie-perl/current/t/open.t
    branches/upstream/libautodie-perl/current/t/version_tag.t

Modified: branches/upstream/libautodie-perl/current/AUTHORS
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libautodie-perl/current/AUTHORS?rev=52331&op=diff
==============================================================================
--- branches/upstream/libautodie-perl/current/AUTHORS (original)
+++ branches/upstream/libautodie-perl/current/AUTHORS Mon Feb  8 22:14:41 2010
@@ -14,7 +14,7 @@
         - Suggesting the name 'lethal', which the module was
           called during much of development.
 
-Jured Waalboer
+Juerd Waalboer
         - Suggesting the name 'autodie'
 
 Aristotle Pagaltzis
@@ -88,3 +88,5 @@
         - Help in tracking down string eval weirdness.
         - Letting me cargo-cult code from B::Hooks::EndOfScope.
 
+Elliot Shank
+        - Integration into Perl::Critic

Modified: branches/upstream/libautodie-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libautodie-perl/current/Changes?rev=52331&op=diff
==============================================================================
--- branches/upstream/libautodie-perl/current/Changes (original)
+++ branches/upstream/libautodie-perl/current/Changes Mon Feb  8 22:14:41 2010
@@ -1,6 +1,16 @@
 Revision history for autodie
 
-2.06_01 Thu Jul 23 18:46:47 PDT 2009
+2.08  Mon Feb  8 14:24:26 AUSEST 2010
+        * BUGFIX: Addeds support for chmod.  Many thanks to
+          Jonathan Yu for reporting this (RT #50423).
+
+        * BUGFIX: Multi-arg open is now supported by open.
+          Many thanks to Nick Ncleaton for finding and fix this
+          bug.  (RT #52427)
+
+        * BUILD: Updated to Module::Install 0.93
+
+2.07  Fri Jul 31 16:35:40 BST 2009
 
         * FEATURE: Added ->eval_error to autodie::exception, which
           stores the contents of $@ at the time autodie throws its
@@ -8,6 +18,14 @@
           such as Text::Balanced which set (but do not throw)
           $@ on error.
 
+        * TEST: Checking for flock() support no longer causes
+          test failures on older VMS sysstems. (RT #47812)
+          Thanks to Craig A. Berry for supplying a patch.
+
+        * TEST: hints.t tests should no longer cause bogus
+          failures relating to File::Copy on VMS and Windows
+          systems prior to Perl 5.10.2.
+
 2.06  Tue Jul  7 00:01:37 AUSEST 2009
 
         * BUG: Explicitly documented that autodie does NOT play
@@ -22,11 +40,6 @@
         * BUGFIX: autodie once again correctly works when used
           inside a string eval.  (This was accidently broken
           somewhere around 1.997-1.998).
-
-        * TEST: Checking for flock() support no longer causes
-          test failures on older VMS sysstems. (RT #47812)
-          Thanks to Craig A. Berry for supplying a patch.
-
 
 2.05  Sat Jul  4 16:33:01 AUSEST 2009
 

Modified: branches/upstream/libautodie-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libautodie-perl/current/MANIFEST?rev=52331&op=diff
==============================================================================
--- branches/upstream/libautodie-perl/current/MANIFEST (original)
+++ branches/upstream/libautodie-perl/current/MANIFEST Mon Feb  8 22:14:41 2010
@@ -31,6 +31,7 @@
 t/crickey.t
 t/critic.t
 t/dbmopen.t
+t/eval_error.t
 t/exception_class.t
 t/exceptions.t
 t/exec.t

Modified: branches/upstream/libautodie-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libautodie-perl/current/META.yml?rev=52331&op=diff
==============================================================================
--- branches/upstream/libautodie-perl/current/META.yml (original)
+++ branches/upstream/libautodie-perl/current/META.yml Mon Feb  8 22:14:41 2010
@@ -8,7 +8,7 @@
 configure_requires:
   ExtUtils::MakeMaker: 6.42
 distribution_type: module
-generated_by: 'Module::Install version 0.91'
+generated_by: 'Module::Install version 0.93'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -27,4 +27,4 @@
   bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=autodie
   license: http://dev.perl.org/licenses/
   repository: http://github.com/pfenwick/autodie/tree/master
-version: 2.06_01
+version: 2.08

Modified: branches/upstream/libautodie-perl/current/inc/Module/Install.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libautodie-perl/current/inc/Module/Install.pm?rev=52331&op=diff
==============================================================================
--- branches/upstream/libautodie-perl/current/inc/Module/Install.pm (original)
+++ branches/upstream/libautodie-perl/current/inc/Module/Install.pm Mon Feb  8 22:14:41 2010
@@ -28,7 +28,7 @@
 	# This is not enforced yet, but will be some time in the next few
 	# releases once we can make sure it won't clash with custom
 	# Module::Install extensions.
-	$VERSION = '0.91';
+	$VERSION = '0.93';
 
 	# Storage for the pseudo-singleton
 	$MAIN    = undef;
@@ -348,17 +348,24 @@
 	return $call;
 }
 
+# Done in evals to avoid confusing Perl::MinimumVersion
+eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
 sub _read {
 	local *FH;
-	if ( $] >= 5.006 ) {
-		open( FH, '<', $_[0] ) or die "open($_[0]): $!";
-	} else {
-		open( FH, "< $_[0]"  ) or die "open($_[0]): $!";
-	}
+	open( FH, '<', $_[0] ) or die "open($_[0]): $!";
 	my $string = do { local $/; <FH> };
 	close FH or die "close($_[0]): $!";
 	return $string;
 }
+END_NEW
+sub _read {
+	local *FH;
+	open( FH, "< $_[0]"  ) or die "open($_[0]): $!";
+	my $string = do { local $/; <FH> };
+	close FH or die "close($_[0]): $!";
+	return $string;
+}
+END_OLD
 
 sub _readperl {
 	my $string = Module::Install::_read($_[0]);
@@ -379,18 +386,26 @@
 	return $string;
 }
 
+# Done in evals to avoid confusing Perl::MinimumVersion
+eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
 sub _write {
 	local *FH;
-	if ( $] >= 5.006 ) {
-		open( FH, '>', $_[0] ) or die "open($_[0]): $!";
-	} else {
-		open( FH, "> $_[0]"  ) or die "open($_[0]): $!";
-	}
+	open( FH, '>', $_[0] ) or die "open($_[0]): $!";
 	foreach ( 1 .. $#_ ) {
 		print FH $_[$_] or die "print($_[0]): $!";
 	}
 	close FH or die "close($_[0]): $!";
 }
+END_NEW
+sub _write {
+	local *FH;
+	open( FH, "> $_[0]"  ) or die "open($_[0]): $!";
+	foreach ( 1 .. $#_ ) {
+		print FH $_[$_] or die "print($_[0]): $!";
+	}
+	close FH or die "close($_[0]): $!";
+}
+END_OLD
 
 # _version is for processing module versions (eg, 1.03_05) not
 # Perl versions (eg, 5.8.1).
@@ -427,4 +442,4 @@
 
 1;
 
-# Copyright 2008 - 2009 Adam Kennedy.
+# Copyright 2008 - 2010 Adam Kennedy.

Modified: branches/upstream/libautodie-perl/current/inc/Module/Install/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libautodie-perl/current/inc/Module/Install/Base.pm?rev=52331&op=diff
==============================================================================
--- branches/upstream/libautodie-perl/current/inc/Module/Install/Base.pm (original)
+++ branches/upstream/libautodie-perl/current/inc/Module/Install/Base.pm Mon Feb  8 22:14:41 2010
@@ -4,7 +4,7 @@
 use strict 'vars';
 use vars qw{$VERSION};
 BEGIN {
-	$VERSION = '0.91';
+	$VERSION = '0.93';
 }
 
 # Suspend handler for "redefined" warnings

Modified: branches/upstream/libautodie-perl/current/inc/Module/Install/Can.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libautodie-perl/current/inc/Module/Install/Can.pm?rev=52331&op=diff
==============================================================================
--- branches/upstream/libautodie-perl/current/inc/Module/Install/Can.pm (original)
+++ branches/upstream/libautodie-perl/current/inc/Module/Install/Can.pm Mon Feb  8 22:14:41 2010
@@ -9,7 +9,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.91';
+	$VERSION = '0.93';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

Modified: branches/upstream/libautodie-perl/current/inc/Module/Install/Fetch.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libautodie-perl/current/inc/Module/Install/Fetch.pm?rev=52331&op=diff
==============================================================================
--- branches/upstream/libautodie-perl/current/inc/Module/Install/Fetch.pm (original)
+++ branches/upstream/libautodie-perl/current/inc/Module/Install/Fetch.pm Mon Feb  8 22:14:41 2010
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.91';
+	$VERSION = '0.93';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

Modified: branches/upstream/libautodie-perl/current/inc/Module/Install/Makefile.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libautodie-perl/current/inc/Module/Install/Makefile.pm?rev=52331&op=diff
==============================================================================
--- branches/upstream/libautodie-perl/current/inc/Module/Install/Makefile.pm (original)
+++ branches/upstream/libautodie-perl/current/inc/Module/Install/Makefile.pm Mon Feb  8 22:14:41 2010
@@ -7,7 +7,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.91';
+	$VERSION = '0.93';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -34,6 +34,17 @@
 	}
 }
 
+# Store a cleaned up version of the MakeMaker version,
+# since we need to behave differently in a variety of
+# ways based on the MM version.
+my $makemaker = eval $ExtUtils::MakeMaker::VERSION;
+
+# If we are passed a param, do a "newer than" comparison.
+# Otherwise, just return the MakeMaker version.
+sub makemaker {
+	( @_ < 2 or $makemaker >= eval($_[1]) ) ? $makemaker : 0
+}
+
 sub makemaker_args {
 	my $self = shift;
 	my $args = ( $self->{makemaker_args} ||= {} );
@@ -44,7 +55,7 @@
 # For mm args that take multiple space-seperated args,
 # append an argument to the current list.
 sub makemaker_append {
-	my $self = sShift;
+	my $self = shift;
 	my $name = shift;
 	my $args = $self->makemaker_args;
 	$args->{name} = defined $args->{$name}
@@ -107,6 +118,9 @@
 	%test_dir = ();
 	require File::Find;
 	File::Find::find( \&_wanted_t, $dir );
+	if ( -d 'xt' and ($ENV{RELEASE_TESTING} or $self->author) ) {
+		File::Find::find( \&_wanted_t, 'xt' );
+	}
 	$self->tests( join ' ', map { "$_/*.t" } sort keys %test_dir );
 }
 
@@ -130,12 +144,13 @@
 		# an underscore, even though its own version may contain one!
 		# Hence the funny regexp to get rid of it.  See RT #35800
 		# for details.
-		$self->build_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ );
-		$self->configure_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ );
+		my $v = $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/;
+		$self->build_requires(     'ExtUtils::MakeMaker' => $v );
+		$self->configure_requires( 'ExtUtils::MakeMaker' => $v );
 	} else {
 		# Allow legacy-compatibility with 5.005 by depending on the
 		# most recent EU:MM that supported 5.005.
-		$self->build_requires( 'ExtUtils::MakeMaker' => 6.42 );
+		$self->build_requires(     'ExtUtils::MakeMaker' => 6.42 );
 		$self->configure_requires( 'ExtUtils::MakeMaker' => 6.42 );
 	}
 
@@ -145,49 +160,75 @@
 	$args->{NAME}     = $self->module_name || $self->name;
 	$args->{VERSION}  = $self->version;
 	$args->{NAME}     =~ s/-/::/g;
+	$DB::single = 1;
 	if ( $self->tests ) {
 		$args->{test} = { TESTS => $self->tests };
+	} elsif ( -d 'xt' and ($self->author or $ENV{RELEASE_TESTING}) ) {
+		$args->{test} = {
+			TESTS => join( ' ', map { "$_/*.t" } grep { -d $_ } qw{ t xt } ),
+		};
 	}
 	if ( $] >= 5.005 ) {
 		$args->{ABSTRACT} = $self->abstract;
 		$args->{AUTHOR}   = $self->author;
 	}
-	if ( eval($ExtUtils::MakeMaker::VERSION) >= 6.10 ) {
-		$args->{NO_META} = 1;
-	}
-	if ( eval($ExtUtils::MakeMaker::VERSION) > 6.17 and $self->sign ) {
+	if ( $self->makemaker(6.10) ) {
+		$args->{NO_META}   = 1;
+		#$args->{NO_MYMETA} = 1;
+	}
+	if ( $self->makemaker(6.17) and $self->sign ) {
 		$args->{SIGN} = 1;
 	}
 	unless ( $self->is_admin ) {
 		delete $args->{SIGN};
 	}
 
-	# Merge both kinds of requires into prereq_pm
 	my $prereq = ($args->{PREREQ_PM} ||= {});
 	%$prereq = ( %$prereq,
-		map { @$_ }
+		map { @$_ } # flatten [module => version]
 		map { @$_ }
 		grep $_,
-		($self->configure_requires, $self->build_requires, $self->requires)
+		($self->requires)
 	);
 
 	# Remove any reference to perl, PREREQ_PM doesn't support it
 	delete $args->{PREREQ_PM}->{perl};
 
-	# merge both kinds of requires into prereq_pm
+	# Merge both kinds of requires into BUILD_REQUIRES
+	my $build_prereq = ($args->{BUILD_REQUIRES} ||= {});
+	%$build_prereq = ( %$build_prereq,
+		map { @$_ } # flatten [module => version]
+		map { @$_ }
+		grep $_,
+		($self->configure_requires, $self->build_requires)
+	);
+
+	# Remove any reference to perl, BUILD_REQUIRES doesn't support it
+	delete $args->{BUILD_REQUIRES}->{perl};
+
+	# Delete bundled dists from prereq_pm
 	my $subdirs = ($args->{DIR} ||= []);
 	if ($self->bundles) {
 		foreach my $bundle (@{ $self->bundles }) {
 			my ($file, $dir) = @$bundle;
 			push @$subdirs, $dir if -d $dir;
-			delete $prereq->{$file};
+			delete $build_prereq->{$file}; #Delete from build prereqs only
 		}
+	}
+
+	unless ( $self->makemaker('6.55_03') ) {
+		%$prereq = (%$prereq,%$build_prereq);
+		delete $args->{BUILD_REQUIRES};
 	}
 
 	if ( my $perl_version = $self->perl_version ) {
 		eval "use $perl_version; 1"
 			or die "ERROR: perl: Version $] is installed, "
 			. "but we need version >= $perl_version";
+
+		if ( $self->makemaker(6.48) ) {
+			$args->{MIN_PERL_VERSION} = $perl_version;
+		}
 	}
 
 	$args->{INSTALLDIRS} = $self->installdirs;
@@ -265,4 +306,4 @@
 
 __END__
 
-#line 394
+#line 435

Modified: branches/upstream/libautodie-perl/current/inc/Module/Install/Metadata.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libautodie-perl/current/inc/Module/Install/Metadata.pm?rev=52331&op=diff
==============================================================================
--- branches/upstream/libautodie-perl/current/inc/Module/Install/Metadata.pm (original)
+++ branches/upstream/libautodie-perl/current/inc/Module/Install/Metadata.pm Mon Feb  8 22:14:41 2010
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.91';
+	$VERSION = '0.93';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -230,6 +230,8 @@
 		die("The path '$file' does not exist, or is not a file");
 	}
 
+	$self->{values}{all_from} = $file;
+
 	# Some methods pull from POD instead of code.
 	# If there is a matching .pod, use that instead
 	my $pod = $file;
@@ -385,11 +387,10 @@
 	}
 }
 
-sub perl_version_from {
-	my $self = shift;
+sub _extract_perl_version {
 	if (
-		Module::Install::_read($_[0]) =~ m/
-		^
+		$_[0] =~ m/
+		^\s*
 		(?:use|require) \s*
 		v?
 		([\d_\.]+)
@@ -398,6 +399,16 @@
 	) {
 		my $perl_version = $1;
 		$perl_version =~ s{_}{}g;
+		return $perl_version;
+	} else {
+		return;
+	}
+}
+
+sub perl_version_from {
+	my $self = shift;
+	my $perl_version=_extract_perl_version(Module::Install::_read($_[0]));
+	if ($perl_version) {
 		$self->perl_version($perl_version);
 	} else {
 		warn "Cannot determine perl version info from $_[0]\n";
@@ -425,13 +436,12 @@
 	}
 }
 
-sub license_from {
-	my $self = shift;
+sub _extract_license {
 	if (
-		Module::Install::_read($_[0]) =~ m/
+		$_[0] =~ m/
 		(
 			=head \d \s+
-			(?:licen[cs]e|licensing|copyright|legal)\b
+			(?:licen[cs]e|licensing|copyrights?|legal)\b
 			.*?
 		)
 		(=head\\d.*|=cut.*|)
@@ -439,7 +449,9 @@
 	/ixms ) {
 		my $license_text = $1;
 		my @phrases      = (
-			'under the same (?:terms|license) as (?:perl|the perl programming language) itself' => 'perl', 1,
+			'under the same (?:terms|license) as (?:perl|the perl programming language)' => 'perl', 1,
+			'under the terms of (?:perl|the perl programming language) itself' => 'perl', 1,
+			'Artistic and GPL'                   => 'perl',        1,
 			'GNU general public license'         => 'gpl',         1,
 			'GNU public license'                 => 'gpl',         1,
 			'GNU lesser general public license'  => 'lgpl',        1,
@@ -456,20 +468,32 @@
 			'proprietary'                        => 'proprietary', 0,
 		);
 		while ( my ($pattern, $license, $osi) = splice(@phrases, 0, 3) ) {
-			$pattern =~ s{\s+}{\\s+}g;
+			$pattern =~ s#\s+#\\s+#gs;
 			if ( $license_text =~ /\b$pattern\b/i ) {
-				$self->license($license);
-				return 1;
+			        return $license;
 			}
 		}
-	}
-
-	warn "Cannot determine license info from $_[0]\n";
-	return 'unknown';
+	} else {
+	        return;
+	}
+}
+
+sub license_from {
+	my $self = shift;
+	if (my $license=_extract_license(Module::Install::_read($_[0]))) {
+		$self->license($license);
+	} else {
+		warn "Cannot determine license info from $_[0]\n";
+		return 'unknown';
+	}
 }
 
 sub _extract_bugtracker {
-	my @links   = $_[0] =~ m#L<(\Qhttp://rt.cpan.org/\E[^>]+)>#g;
+	my @links   = $_[0] =~ m#L<(
+	 \Qhttp://rt.cpan.org/\E[^>]+|
+	 \Qhttp://github.com/\E[\w_]+/[\w_]+/issues|
+	 \Qhttp://code.google.com/p/\E[\w_\-]+/issues/list
+	 )>#gx;
 	my %links;
 	@links{@links}=();
 	@links=keys %links;
@@ -485,7 +509,7 @@
 		return 0;
 	}
 	if ( @links > 1 ) {
-		warn "Found more than on rt.cpan.org link in $_[0]\n";
+		warn "Found more than one bugtracker link in $_[0]\n";
 		return 0;
 	}
 

Modified: branches/upstream/libautodie-perl/current/inc/Module/Install/Win32.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libautodie-perl/current/inc/Module/Install/Win32.pm?rev=52331&op=diff
==============================================================================
--- branches/upstream/libautodie-perl/current/inc/Module/Install/Win32.pm (original)
+++ branches/upstream/libautodie-perl/current/inc/Module/Install/Win32.pm Mon Feb  8 22:14:41 2010
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.91';
+	$VERSION = '0.93';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

Modified: branches/upstream/libautodie-perl/current/inc/Module/Install/WriteAll.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libautodie-perl/current/inc/Module/Install/WriteAll.pm?rev=52331&op=diff
==============================================================================
--- branches/upstream/libautodie-perl/current/inc/Module/Install/WriteAll.pm (original)
+++ branches/upstream/libautodie-perl/current/inc/Module/Install/WriteAll.pm Mon Feb  8 22:14:41 2010
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.91';;
+	$VERSION = '0.93';;
 	@ISA     = qw{Module::Install::Base};
 	$ISCORE  = 1;
 }

Modified: branches/upstream/libautodie-perl/current/lib/Fatal.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libautodie-perl/current/lib/Fatal.pm?rev=52331&op=diff
==============================================================================
--- branches/upstream/libautodie-perl/current/lib/Fatal.pm (original)
+++ branches/upstream/libautodie-perl/current/lib/Fatal.pm Mon Feb  8 22:14:41 2010
@@ -5,6 +5,7 @@
 use strict;
 use warnings;
 use Tie::RefHash;   # To cache subroutine refs
+use Config;
 
 use constant PERL510     => ( $] >= 5.010 );
 
@@ -39,7 +40,7 @@
 use constant MIN_IPC_SYS_SIMPLE_VER => 0.12;
 
 # All the Fatal/autodie modules share the same version number.
-our $VERSION = '2.06_01';
+our $VERSION = '2.08';
 
 our $Debug ||= 0;
 
@@ -51,6 +52,10 @@
 our %_EWOULDBLOCK = (
     MSWin32 => 33,
 );
+
+# the linux parisc port has separate EAGAIN and EWOULDBLOCK,
+# and the kernel returns EAGAIN
+my $try_EAGAIN = ($^O eq 'linux' and $Config{archname} =~ /hppa|parisc/) ? 1 : 0;
 
 # We have some tags that can be passed in for use with import.
 # These are all assumed to be CORE::
@@ -60,7 +65,7 @@
                        read seek sysread syswrite sysseek )],
     ':dbm'     => [qw(dbmopen dbmclose)],
     ':file'    => [qw(open close flock sysopen fcntl fileno binmode
-                     ioctl truncate)],
+                     ioctl truncate chmod)],
     ':filesys' => [qw(opendir closedir chdir link unlink rename mkdir
                       symlink rmdir readlink umask)],
     ':ipc'     => [qw(:msg :semaphore :shm pipe)],
@@ -84,25 +89,34 @@
 
     ':default' => [qw(:io :threads)],
 
+    # Everything in v2.07 and brefore. This was :default less chmod.
+    ':v207'    => [qw(:threads :dbm :filesys :ipc :socket read seek sysread
+                   syswrite sysseek open close flock sysopen fcntl fileno
+                   binmode ioctl truncate)],
+
     # Version specific tags.  These allow someone to specify
     # use autodie qw(:1.994) and know exactly what they'll get.
 
-    ':1.994' => [qw(:default)],
-    ':1.995' => [qw(:default)],
-    ':1.996' => [qw(:default)],
-    ':1.997' => [qw(:default)],
-    ':1.998' => [qw(:default)],
-    ':1.999' => [qw(:default)],
-    ':1.999_01' => [qw(:default)],
-    ':2.00'  => [qw(:default)],
-    ':2.01'  => [qw(:default)],
-    ':2.02'  => [qw(:default)],
-    ':2.03'  => [qw(:default)],
-    ':2.04'  => [qw(:default)],
-    ':2.05'  => [qw(:default)],
-    ':2.06'  => [qw(:default)],
-    ':2.06_01' => [qw(:default)],
+    ':1.994' => [qw(:v207)],
+    ':1.995' => [qw(:v207)],
+    ':1.996' => [qw(:v207)],
+    ':1.997' => [qw(:v207)],
+    ':1.998' => [qw(:v207)],
+    ':1.999' => [qw(:v207)],
+    ':1.999_01' => [qw(:v207)],
+    ':2.00'  => [qw(:v207)],
+    ':2.01'  => [qw(:v207)],
+    ':2.02'  => [qw(:v207)],
+    ':2.03'  => [qw(:v207)],
+    ':2.04'  => [qw(:v207)],
+    ':2.05'  => [qw(:v207)],
+    ':2.06'  => [qw(:v207)],
+    ':2.06_01' => [qw(:v207)],
+    ':2.07'  => [qw(:v207)],     # Last release without chmod
+    ':2.08'  => [qw(:default)],
 );
+
+# chmod was only introduced in 2.07
 
 $TAGS{':all'}  = [ keys %TAGS ];
 
@@ -168,6 +182,7 @@
 
 sub import {
     my $class        = shift(@_);
+    my @original_args = @_;
     my $void         = 0;
     my $lexical      = 0;
     my $insist_hints = 0;
@@ -305,6 +320,16 @@
         push(@ { $^H{$PACKAGE_GUARD} }, autodie::Scope::Guard->new(sub {
             $class->_install_subs($pkg, \%unload_later);
         }));
+
+        # To allow others to determine when autodie was in scope,
+        # and with what arguments, we also set a %^H hint which
+        # is how we were called.
+
+        # This feature should be considered EXPERIMENTAL, and
+        # may change without notice.  Please e-mail pjf at cpan.org
+        # if you're actually using it.
+
+        $^H{autodie} = "$PACKAGE @original_args";
 
     }
 
@@ -449,8 +474,10 @@
 
         while (my $item = shift @to_process) {
             if ($item =~ /^:/) {
+                # Expand :tags
                 push(@to_process, @{$TAGS{$item}} );
-            } else {
+            }
+            else {
                 push(@taglist, "CORE::$item");
             }
         }
@@ -520,7 +547,17 @@
             @argv = @{shift @argvs};
             $n = shift @argv;
 
-            push @out, "${else}if (\@_ == $n) {\n";
+            my $condition = "\@_ == $n";
+
+            if (@argv and $argv[-1] =~ /#_/) {
+                # This argv ends with '@' in the prototype, so it matches
+                # any number of args >= the number of expressions in the
+                # argv.
+                $condition = "\@_ >= $n";
+            }
+
+            push @out, "${else}if ($condition) {\n";
+
             $else = "\t} els";
 
         push @out, $class->_one_invocation($core,$call,$name,$void,$sub,! $lexical, $sref, @argv);
@@ -720,6 +757,11 @@
         my $EWOULDBLOCK = eval { POSIX::EWOULDBLOCK(); }
                           || $_EWOULDBLOCK{$^O}
                           || _autocroak("Internal error - can't overload flock - EWOULDBLOCK not defined on this system.");
+        my $EAGAIN = $EWOULDBLOCK;
+        if ($try_EAGAIN) {
+            $EAGAIN = eval { POSIX::EAGAIN(); }
+                          || _autocroak("Internal error - can't overload flock - EAGAIN not defined on this system.");
+        }
 
         require Fcntl;      # For Fcntl::LOCK_NB
 
@@ -735,7 +777,9 @@
             # If we failed, but we're using LOCK_NB and
             # returned EWOULDBLOCK, it's not a real error.
 
-            if (\$_[1] & Fcntl::LOCK_NB() and \$! == $EWOULDBLOCK ) {
+            if (\$_[1] & Fcntl::LOCK_NB() and
+                (\$! == $EWOULDBLOCK or
+                ($try_EAGAIN and \$! == $EAGAIN ))) {
                 return \$retval;
             }
 

Modified: branches/upstream/libautodie-perl/current/lib/autodie.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libautodie-perl/current/lib/autodie.pm?rev=52331&op=diff
==============================================================================
--- branches/upstream/libautodie-perl/current/lib/autodie.pm (original)
+++ branches/upstream/libautodie-perl/current/lib/autodie.pm Mon Feb  8 22:14:41 2010
@@ -8,7 +8,7 @@
 our $VERSION;
 
 BEGIN {
-    $VERSION = '2.06_01';
+    $VERSION = '2.08';
 }
 
 use constant ERROR_WRONG_FATAL => q{

Modified: branches/upstream/libautodie-perl/current/lib/autodie/exception.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libautodie-perl/current/lib/autodie/exception.pm?rev=52331&op=diff
==============================================================================
--- branches/upstream/libautodie-perl/current/lib/autodie/exception.pm (original)
+++ branches/upstream/libautodie-perl/current/lib/autodie/exception.pm Mon Feb  8 22:14:41 2010
@@ -14,7 +14,7 @@
 
 use if ($] >= 5.010), overload => '~~'  => "matches";
 
-our $VERSION = '2.06_01';
+our $VERSION = '2.08';
 
 my $PACKAGE = __PACKAGE__;  # Useful to have a scalar for hash keys.
 

Modified: branches/upstream/libautodie-perl/current/lib/autodie/exception/system.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libautodie-perl/current/lib/autodie/exception/system.pm?rev=52331&op=diff
==============================================================================
--- branches/upstream/libautodie-perl/current/lib/autodie/exception/system.pm (original)
+++ branches/upstream/libautodie-perl/current/lib/autodie/exception/system.pm Mon Feb  8 22:14:41 2010
@@ -5,7 +5,7 @@
 use base 'autodie::exception';
 use Carp qw(croak);
 
-our $VERSION = '2.06_01';
+our $VERSION = '2.08';
 
 my $PACKAGE = __PACKAGE__;
 

Modified: branches/upstream/libautodie-perl/current/lib/autodie/hints.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libautodie-perl/current/lib/autodie/hints.pm?rev=52331&op=diff
==============================================================================
--- branches/upstream/libautodie-perl/current/lib/autodie/hints.pm (original)
+++ branches/upstream/libautodie-perl/current/lib/autodie/hints.pm Mon Feb  8 22:14:41 2010
@@ -5,7 +5,7 @@
 
 use constant PERL58 => ( $] < 5.009 );
 
-our $VERSION = '2.06_01';
+our $VERSION = '2.08';
 
 =head1 NAME
 

Added: branches/upstream/libautodie-perl/current/t/eval_error.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libautodie-perl/current/t/eval_error.t?rev=52331&op=file
==============================================================================
--- branches/upstream/libautodie-perl/current/t/eval_error.t (added)
+++ branches/upstream/libautodie-perl/current/t/eval_error.t Mon Feb  8 22:14:41 2010
@@ -1,0 +1,20 @@
+#!/usr/bin/perl -w
+use strict;
+use warnings;
+use Test::More 'no_plan';
+use autodie;
+
+use constant NO_SUCH_FILE => 'this_file_had_better_not_exist';
+use constant MAGIC_STRING => 'xyzzy';
+
+# Opening an eval clears $@, so it's important that we set it
+# inside the eval block to see if it's successfully captured.
+
+eval {
+    $@ = MAGIC_STRING;
+    is($@, MAGIC_STRING, 'Sanity check on start conditions');
+    open(my $fh, '<', NO_SUCH_FILE);
+};
+
+isa_ok($@, 'autodie::exception');
+is($@->eval_error, MAGIC_STRING, 'Previous $@ should be captured');

Propchange: branches/upstream/libautodie-perl/current/t/eval_error.t
------------------------------------------------------------------------------
    svn:executable = *

Modified: branches/upstream/libautodie-perl/current/t/flock.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libautodie-perl/current/t/flock.t?rev=52331&op=diff
==============================================================================
--- branches/upstream/libautodie-perl/current/t/flock.t (original)
+++ branches/upstream/libautodie-perl/current/t/flock.t Mon Feb  8 22:14:41 2010
@@ -2,13 +2,17 @@
 use strict;
 use Test::More;
 use Fcntl qw(:flock);
-use POSIX qw(EWOULDBLOCK);
+use POSIX qw(EWOULDBLOCK EAGAIN);
+use Config;
 
 require Fatal;
 
 my $EWOULDBLOCK = eval { EWOULDBLOCK() }
                   || $Fatal::_EWOULDBLOCK{$^O}
                   || plan skip_all => "EWOULDBLOCK not defined on this system";
+
+my $try_EAGAIN = ($^O eq 'linux' and $Config{archname} =~ /hppa|parisc/) ? 1 : 0;
+my $EAGAIN = eval { EAGAIN() };
 
 my ($self_fh, $self_fh2);
 
@@ -55,7 +59,11 @@
     $return = flock($self_fh2, LOCK_EX | LOCK_NB);
 };
 
-is($!+0, $EWOULDBLOCK, "Double-flocking should be EWOULDBLOCK");
+if (!$try_EAGAIN) {
+    is($!+0, $EWOULDBLOCK, "Double-flocking should be EWOULDBLOCK");
+} else {
+    ok($!+0 == $EWOULDBLOCK || $!+0 == $EAGAIN, "Double-flocking should be EWOULDBLOCK or EAGAIN");
+}
 ok(!$return, "flocking a file twice should fail");
 is($@, "", "Non-blocking flock should not fail on EWOULDBLOCK");
 

Modified: branches/upstream/libautodie-perl/current/t/internal-backcompat.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libautodie-perl/current/t/internal-backcompat.t?rev=52331&op=diff
==============================================================================
--- branches/upstream/libautodie-perl/current/t/internal-backcompat.t (original)
+++ branches/upstream/libautodie-perl/current/t/internal-backcompat.t Mon Feb  8 22:14:41 2010
@@ -33,7 +33,7 @@
 
 # Technically the outputted code varies from the classical Fatal.
 # However the changes are mostly whitespace.  Those that aren't are
-# improvements to error messages.
+# improvements to error messages or bug fixes.
 
 my @write_invocation_calls = (
     [
@@ -44,7 +44,7 @@
         ],
         q{	if (@_ == 1) {
 return CORE::open($_[0]) || croak "Can't open(@_): $!"	} elsif (@_ == 2) {
-return CORE::open($_[0], $_[1]) || croak "Can't open(@_): $!"	} elsif (@_ == 3) {
+return CORE::open($_[0], $_[1]) || croak "Can't open(@_): $!"	} elsif (@_ >= 3) {
 return CORE::open($_[0], $_[1], @_[2..$#_]) || croak "Can't open(@_): $!"
             }
             die "Internal error: open(@_): Do not expect to get ", scalar(@_), " arguments";

Modified: branches/upstream/libautodie-perl/current/t/open.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libautodie-perl/current/t/open.t?rev=52331&op=diff
==============================================================================
--- branches/upstream/libautodie-perl/current/t/open.t (original)
+++ branches/upstream/libautodie-perl/current/t/open.t Mon Feb  8 22:14:41 2010
@@ -47,3 +47,30 @@
 isa_ok($@, 'autodie::exception');
 like(  $@, qr/at \S+ line \d+/, "At least one mention");
 unlike($@, qr/at \S+ line \d+\s+at \S+ line \d+/, "...but not too mentions");
+
+# RT 52427.  Piped open can have any many args.
+
+# Sniff to see if we can run 'true' on this system.  Changes we can't
+# on non-Unix systems.
+
+eval {
+    use autodie;
+
+    open(my $fh, '-|', "true");
+};
+
+SKIP: {
+    skip('true command not on this system', 1) if $@;
+
+    eval {
+        use autodie;
+
+        my $fh;
+        open $fh, "-|", "true";
+        open $fh, "-|", "true", "foo";
+        open $fh, "-|", "true", "foo", "bar";
+        open $fh, "-|", "true", "foo", "bar", "baz";
+    };
+
+    is $@, '', "multi arg piped open does not fail";
+}

Modified: branches/upstream/libautodie-perl/current/t/version_tag.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libautodie-perl/current/t/version_tag.t?rev=52331&op=diff
==============================================================================
--- branches/upstream/libautodie-perl/current/t/version_tag.t (original)
+++ branches/upstream/libautodie-perl/current/t/version_tag.t Mon Feb  8 22:14:41 2010
@@ -1,7 +1,8 @@
 #!/usr/bin/perl -w
 use strict;
 use warnings;
-use Test::More tests => 3;
+use Test::More tests => 5;
+use constant NO_SUCH_FILE => 'THIS_FILE_HAD_BETTER_NOT_EXIST';
 
 eval {
     use autodie qw(:1.994);
@@ -10,7 +11,6 @@
 };
 
 isa_ok($@, 'autodie::exception', "Basic version tags work");
-
 
 # Expanding :1.00 should fail, there was no autodie :1.00
 eval { my $foo = autodie->_expand_tag(":1.00"); };
@@ -24,3 +24,21 @@
 
 is($@,"","Expanding :$version should succeed");
 
+eval {
+    use autodie qw(:2.07);
+
+    # 2.07 didn't support chmod.  This shouldn't throw an
+    # exception.
+
+    chmod(0644,NO_SUCH_FILE);
+};
+
+is($@,"","chmod wasn't supported in 2.07");
+
+eval {
+    use autodie;
+
+    chmod(0644,NO_SUCH_FILE);
+};
+
+isa_ok($@, 'autodie::exception', 'Our current version supports chmod');




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