rpms/perl/devel perl-update-autodie.patch, NONE, 1.1 perl.spec, 1.211, 1.212

Štěpán Kasal kasal at fedoraproject.org
Tue Mar 24 14:57:56 UTC 2009


Author: kasal

Update of /cvs/extras/rpms/perl/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv1206

Modified Files:
	perl.spec 
Added Files:
	perl-update-autodie.patch 
Log Message:
- update module autodie

perl-update-autodie.patch:

--- NEW FILE perl-update-autodie.patch ---
autodie-1.999

diff -urN perl-5.10.0.orig/MANIFEST perl-5.10.0/MANIFEST
--- perl-5.10.0.orig/MANIFEST	2009-02-20 18:22:32.000000000 +0100
+++ perl-5.10.0/MANIFEST	2009-03-24 12:42:25.000000000 +0100
@@ -1442,6 +1442,9 @@
 lib/Attribute/Handlers/t/linerep.t	See if Attribute::Handlers works
 lib/Attribute/Handlers/t/multi.t	See if Attribute::Handlers works
 lib/attributes.pm		For "sub foo : attrlist"
+lib/autodie.pm                  Functions suceed or die with lexical scope
+lib/autodie/exception.pm        Exception class for autodie
+lib/autodie/exception/system.pm Exception class for autodying system()
 lib/AutoLoader.pm		Autoloader base class
 lib/AutoLoader.t		See if AutoLoader works
 lib/AutoSplit.pm		Split up autoload functions
@@ -3439,6 +3442,45 @@
 t/io/utf8.t			See if file seeking works
 t/japh/abigail.t		Obscure tests
 t/lib/1_compile.t		See if the various libraries and extensions compile
+t/lib/autodie/00-load.t             autodie - basic load
+t/lib/autodie/autodie.t             autodie - Basic functionality
+t/lib/autodie/autodie_test_module.pm    autodie - test helper
+t/lib/autodie/backcompat.t          autodie - More Fatal backcompat
+t/lib/autodie/basic_exceptions.t    autodie - Basic exception tests
+t/lib/autodie/binmode.t             autodie - Binmode testing
+t/lib/autodie/caller.t			autodie - Caller diagnostics
+t/lib/autodie/context.t             autodie - Context clobbering tests
+t/lib/autodie/context_lexical.t		autodie - Context clobbering lexically
+t/lib/autodie/crickey.t             autodie - Like an Australian
+t/lib/autodie/dbmopen.t             autodie - dbm tests
+t/lib/autodie/exceptions.t          autodie - 5.10 exception tests.
+t/lib/autodie/exception_class.t		autodie - Exception class subclasses
+t/lib/autodie/exec.t                autodie - exec tests.
+t/lib/autodie/Fatal.t               autodie - Fatal backcompatibility
+t/lib/autodie/filehandles.t         autodie - filehandle tests
+t/lib/autodie/fileno.t              autodie - fileno tests
+t/lib/autodie/flock.t               autodie - File locking tests
+t/lib/autodie/internal.t            autodie - internal interface tests
+t/lib/autodie/lethal.t              autodie - lethal is the one true name
+t/lib/autodie/lib/autodie/test/au.pm autodie - Austrlaian helper
+t/lib/autodie/lib/autodie/test/au/exception.pm autodie - Australian helper
+t/lib/autodie/lib/autodie/test/badname.pm   autodie - Bad exception class
+t/lib/autodie/lib/autodie/test/missing.pm   autodie - Missing exception class
+t/lib/autodie/lib/lethal.pm         autodie - with a better name
+t/lib/autodie/lib/pujHa/ghach.pm    autodie - Like a Klingon
+t/lib/autodie/lib/pujHa/ghach/Dotlh.pm  autodie - With Klingon honour
+t/lib/autodie/mkdir.t               autodie - filesystem tests
+t/lib/autodie/open.t                autodie - Testing open
+t/lib/autodie/recv.t                autodie - send/recv tests
+t/lib/autodie/repeat.t              autodie - repeat autodie leak tests
+t/lib/autodie/scope_leak.t          autodie - file scope leak tests
+t/lib/autodie/sysopen.t             autodie - sysopen tests
+t/lib/autodie/truncate.t            autodie - File truncation tests
+t/lib/autodie/unlink.t              autodie - Unlink system tests.
+t/lib/autodie/user-context.t		autodie - Context changes for usersubs
+t/lib/autodie/usersub.t             autodie - user subroutine tests
+t/lib/autodie/version.t             autodie - versioning tests
+t/lib/autodie/version_tag.t
 t/lib/Cname.pm			Test charnames in regexes (op/pat.t)
 t/lib/common.pl			Helper for lib/{warnings,feature}.t
 t/lib/commonsense.t		See if configuration meets basic needs
diff -urN perl-5.10.0.orig/Porting/Maintainers.pl perl-5.10.0/Porting/Maintainers.pl
--- perl-5.10.0.orig/Porting/Maintainers.pl	2007-12-18 11:47:07.000000000 +0100
+++ perl-5.10.0/Porting/Maintainers.pl	2009-03-24 11:53:29.000000000 +0100
@@ -57,6 +57,7 @@
 	'p5p'		=> 'perl5-porters <perl5-porters at perl.org>',
 	'perlfaq'	=> 'perlfaq-workers <perlfaq-workers at perl.org>',
 	'petdance'	=> 'Andy Lester <andy at petdance.com>',
+	'pjf'		=> 'Paul Fenwick <pjf at cpan.org>',
 	'pmqs'		=> 'Paul Marquess <pmqs at cpan.org>',
 	'pvhp'		=> 'Peter Prymmer <pvhp at best.com>',
 	'rclamp'	=> 'Richard Clamp <rclamp at cpan.org>',
@@ -113,6 +114,14 @@
 		'CPAN'		=> 1,
 		},
 
+	'autodie' =>
+		{
+		'MAINTAINER'    => 'pjf',
+		'FILES'         => q[lib/Fatal.pm lib/autodie.pm lib/autodie],
+		'CPAN'          => 1,
+		'UPSTREAM'      => 'cpan',
+		},
+
 	'B::Concise' =>
 		{
 		'MAINTAINER'	=> 'smccam',
diff -urN perl-5.10.0.orig/installperl perl-5.10.0/installperl
--- perl-5.10.0.orig/installperl	2007-12-18 11:47:07.000000000 +0100
+++ perl-5.10.0/installperl	2009-03-24 12:42:25.000000000 +0100
@@ -827,7 +827,7 @@
     $name = "$dir/$name" if $dir ne '';
 
     my $installlib = $installprivlib;
-    if ($dir =~ /^auto/ ||
+    if ($dir =~ /^auto\// ||
 	  ($name =~ /^(.*)\.(?:pm|pod)$/ && $archpms{$1}) ||
 	  ($name =~ /^(.*)\.(?:h|lib)$/i && ($Is_W32 || $Is_NetWare)) ||
 	  $name eq 'Config_heavy.pl'
diff -urN perl-5.10.0.orig/lib/Fatal.pm perl-5.10.0/lib/Fatal.pm
--- perl-5.10.0.orig/lib/Fatal.pm	2009-03-24 13:14:31.000000000 +0100
+++ perl-5.10.0/lib/Fatal.pm	2009-03-24 13:15:35.000000000 +0100
@@ -1,137 +1,1002 @@
 package Fatal;
 
-use 5.006_001;
+use 5.008;  # 5.8.x needed for autodie
 use Carp;
 use strict;
-our($AUTOLOAD, $Debug, $VERSION);
+use warnings;
 
-$VERSION = 1.06;
+use constant LEXICAL_TAG => q{:lexical};
+use constant VOID_TAG    => q{:void};
 
-$Debug = 0 unless defined $Debug;
+use constant ERROR_NOARGS    => 'Cannot use lexical %s with no arguments';
+use constant ERROR_VOID_LEX  => VOID_TAG.' cannot be used with lexical scope';
+use constant ERROR_LEX_FIRST => LEXICAL_TAG.' must be used as first argument';
+use constant ERROR_NO_LEX    => "no %s can only start with ".LEXICAL_TAG;
+use constant ERROR_BADNAME   => "Bad subroutine name for %s: %s";
+use constant ERROR_NOTSUB    => "%s is not a Perl subroutine";
+use constant ERROR_NOT_BUILT => "%s is neither a builtin, nor a Perl subroutine";
+use constant ERROR_CANT_OVERRIDE => "Cannot make the non-overridable builtin %s fatal";
+
+use constant ERROR_NO_IPC_SYS_SIMPLE => "IPC::System::Simple required for Fatalised/autodying system()";
+
+use constant ERROR_IPC_SYS_SIMPLE_OLD => "IPC::System::Simple version %f required for Fatalised/autodying system().  We only have version %f";
+
+use constant ERROR_AUTODIE_CONFLICT => q{"no autodie '%s'" is not allowed while "use Fatal '%s'" is in effect};
+
+use constant ERROR_FATAL_CONFLICT => q{"use Fatal '%s'" is not allowed while "no autodie '%s'" is in effect};
+
+# Older versions of IPC::System::Simple don't support all the
+# features we need.
+
+use constant MIN_IPC_SYS_SIMPLE_VER => 0.12;
+
+# All the Fatal/autodie modules share the same version number.
+our $VERSION = '1.999';
+
+our $Debug ||= 0;
+
+# EWOULDBLOCK values for systems that don't supply their own.
+# Even though this is defined with our, that's to help our
+# test code.  Please don't rely upon this variable existing in
+# the future.
+
+our %_EWOULDBLOCK = (
+    MSWin32 => 33,
+);
+
+# We have some tags that can be passed in for use with import.
+# These are all assumed to be CORE::
+
+my %TAGS = (
+    ':io'      => [qw(:dbm :file :filesys :ipc :socket
+                       read seek sysread syswrite sysseek )],
+    ':dbm'     => [qw(dbmopen dbmclose)],
+    ':file'    => [qw(open close flock sysopen fcntl fileno binmode
+                     ioctl truncate)],
+    ':filesys' => [qw(opendir closedir chdir link unlink rename mkdir
+                      symlink rmdir readlink umask)],
+    ':ipc'     => [qw(:msg :semaphore :shm pipe)],
+    ':msg'     => [qw(msgctl msgget msgrcv msgsnd)],
+    ':threads' => [qw(fork)],
+    ':semaphore'=>[qw(semctl semget semop)],
+    ':shm'     => [qw(shmctl shmget shmread)],
+    ':system'  => [qw(system exec)],
+
+    # Can we use qw(getpeername getsockname)? What do they do on failure?
+    # XXX - Can socket return false?
+    ':socket'  => [qw(accept bind connect getsockopt listen recv send
+                   setsockopt shutdown socketpair)],
+
+    # Our defaults don't include system(), because it depends upon
+    # an optional module, and it breaks the exotic form.
+    #
+    # This *may* change in the future.  I'd love IPC::System::Simple
+    # to be a dependency rather than a recommendation, and hence for
+    # system() to be autodying by default.
+
+    ':default' => [qw(:io :threads)],
+
+    # 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)],
+
+);
+
+$TAGS{':all'}  = [ keys %TAGS ];
+
[...3812 lines suppressed...]
+	use autodie;
+
+	unlink TMPFILE;
+};
+is($@, "", "Unlink appears to have been successful");
+ok(! -e TMPFILE, "File does not exist");
+
+# Try to delete file again (this should fail)
+eval {
+	use autodie;
+
+	unlink TMPFILE;
+};
+ok($@, "Re-unlinking file causes failure.");
+isa_ok($@, "autodie::exception", "... errors are of the correct type");
+ok($@->matches("unlink"), "... it's also a unlink object");
+ok($@->matches(":filesys"), "... and a filesys object");
+
diff -urN perl-5.10.0.orig/t/lib/autodie/user-context.t perl-5.10.0/t/lib/autodie/user-context.t
--- perl-5.10.0.orig/t/lib/autodie/user-context.t	1970-01-01 01:00:00.000000000 +0100
+++ perl-5.10.0/t/lib/autodie/user-context.t	2009-03-24 12:42:25.000000000 +0100
@@ -0,0 +1,59 @@
+#!/usr/bin/perl -w
+use strict;
+use warnings;
+use Test::More 'no_plan';
+use File::Copy;
+use constant NO_SUCH_FILE => 'this_file_had_better_not_exist';
+use constant EXCEPTION => 'autodie::exception';
+
+# http://perlmonks.org/?node_id=744246 describes a situation where
+# using autodie on user-defined functions can fail, depending upon
+# their context.  These tests attempt to detect this bug.
+
+eval {
+    use autodie qw(copy);
+    copy(NO_SUCH_FILE, 'xyzzy');
+};
+
+isa_ok($@,EXCEPTION,"Copying a non-existent file should throw an error");
+
+eval {
+    use autodie qw(copy);
+    my $x = copy(NO_SUCH_FILE, 'xyzzy');
+};
+
+isa_ok($@,EXCEPTION,"This shouldn't change with scalar context");
+
+eval {
+    use autodie qw(copy);
+    my @x = copy(NO_SUCH_FILE, 'xyzzy');
+};
+
+TODO: {
+    local $TODO = "Fixed in 'hints' branch";
+
+    isa_ok($@,EXCEPTION,"This shouldn't change with array context");
+}
+
+# For good measure, test with built-ins.
+
+eval {
+    use autodie qw(open);
+    open(my $fh, '<', 'xyzzy');
+};
+
+isa_ok($@,EXCEPTION,"Opening a non-existent file should throw an error");
+
+eval {
+    use autodie qw(open);
+    my $x = open(my $fh, '<', 'xyzzy');
+};
+
+isa_ok($@,EXCEPTION,"This shouldn't change with scalar context");
+
+eval {
+    use autodie qw(open);
+    my @x = open(my $fh, '<', 'xyzzy');
+};
+
+isa_ok($@,EXCEPTION,"This shouldn't change with array context");
diff -urN perl-5.10.0.orig/t/lib/autodie/usersub.t perl-5.10.0/t/lib/autodie/usersub.t
--- perl-5.10.0.orig/t/lib/autodie/usersub.t	1970-01-01 01:00:00.000000000 +0100
+++ perl-5.10.0/t/lib/autodie/usersub.t	2009-03-24 11:53:29.000000000 +0100
@@ -0,0 +1,64 @@
+#!/usr/bin/perl -w
+use strict;
+
+use Test::More 'no_plan';
+
+sub mytest {
+    return $_[0];
+}
+
+is(mytest(q{foo}),q{foo},"Mytest returns input");
+
+my $return = eval { mytest(undef); };
+
+ok(!defined($return), "mytest returns undef without autodie");
+is($@,"","Mytest doesn't throw an exception without autodie");
+
+$return = eval {
+    use autodie qw(mytest);
+
+    mytest('foo');
+};
+
+is($return,'foo',"Mytest returns input with autodie");
+
+$return = eval {
+    use autodie qw(mytest);
+
+    mytest(undef);
+};
+
+isa_ok($@,'autodie::exception',"autodie mytest/undef throws exception");
+
+# We set initial values here because we're expecting $data to be
+# changed to undef later on.   Having it as undef to begin with means
+# we can't see mytest(undef) working correctly.
+
+my ($data, $data2) = (1,1);
+
+eval {
+    use autodie qw(mytest);
+
+    {
+        no autodie qw(mytest);
+
+        $data  = mytest(undef);
+        $data2 = mytest('foo');
+    }
+};
+
+is($@,"","no autodie can counter use autodie for user subs");
+ok(!defined($data), "mytest(undef) should return undef");
+is($data2, "foo", "mytest(foo) should return foo");
+
+eval {
+    mytest(undef);
+};
+
+is($@,"","No lingering failure effects");
+
+$return = eval {
+    mytest("bar");
+};
+
+is($return,"bar","No lingering return effects");
diff -urN perl-5.10.0.orig/t/lib/autodie/version.t perl-5.10.0/t/lib/autodie/version.t
--- perl-5.10.0.orig/t/lib/autodie/version.t	1970-01-01 01:00:00.000000000 +0100
+++ perl-5.10.0/t/lib/autodie/version.t	2009-03-24 11:53:29.000000000 +0100
@@ -0,0 +1,17 @@
+#!/usr/bin/perl -w
+use strict;
+use Test::More tests => 3;
+
+# For the moment, we'd like all our versions to be the same.
+# In order to play nicely with some code scanners, they need to be
+# hard-coded into the files, rather than just nicking the version
+# from autodie::exception at run-time.
+
+require Fatal;
+require autodie;
+require autodie::exception;
+require autodie::exception::system;
+
+is($Fatal::VERSION, $autodie::VERSION);
+is($autodie::VERSION, $autodie::exception::VERSION);
+is($autodie::exception::VERSION, $autodie::exception::system::VERSION);
diff -urN perl-5.10.0.orig/t/lib/autodie/version_tag.t perl-5.10.0/t/lib/autodie/version_tag.t
--- perl-5.10.0.orig/t/lib/autodie/version_tag.t	1970-01-01 01:00:00.000000000 +0100
+++ perl-5.10.0/t/lib/autodie/version_tag.t	2009-03-24 11:53:29.000000000 +0100
@@ -0,0 +1,26 @@
+#!/usr/bin/perl -w
+use strict;
+use warnings;
+use Test::More tests => 3;
+
+eval {
+    use autodie qw(:1.994);
+
+    open(my $fh, '<', 'this_file_had_better_not_exist.txt');
+};
+
+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"); };
+
+isnt($@,"","Expanding :1.00 should fail");
+
+my $version = $autodie::VERSION;
+
+# Expanding our current version should work!
+eval { my $foo = autodie->_expand_tag(":$version"); };
+
+is($@,"","Expanding :$version should succeed");
+


Index: perl.spec
===================================================================
RCS file: /cvs/extras/rpms/perl/devel/perl.spec,v
retrieving revision 1.211
retrieving revision 1.212
diff -u -r1.211 -r1.212
--- perl.spec	23 Mar 2009 16:43:17 -0000	1.211
+++ perl.spec	24 Mar 2009 14:57:25 -0000	1.212
@@ -7,7 +7,7 @@
 
 Name:           perl
 Version:        %{perl_version}
-Release:        63%{?dist}
+Release:        64%{?dist}
 Epoch:          %{perl_epoch}
 Summary:        Practical Extraction and Report Language
 Group:          Development/Languages
@@ -216,6 +216,9 @@
 %define			    Time_HiRes_version 1.9719
 Patch117:	perl-update-Digest-SHA.patch
 %define			    Digest_SHA_version 5.47
+# includes Fatal.pm
+Patch118:	perl-update-autodie.patch
+%define			    autodie_version 1.999
 
 # Fedora uses links instead of lynx
 # patches File-Fetch and CPAN
@@ -988,6 +991,7 @@
 %patch115 -p1
 %patch116 -p1
 %patch117 -p1
+%patch118 -p1
 %patch201 -p1
 
 #
@@ -1230,7 +1234,7 @@
 	'Fedora Patch55: File::Path::rmtree no longer allows creating of setuid files.' \
 	'Fedora Patch56: Fix $? when dumping core' \
 	'34209 Fix a memory leak with Scalar::Util::weaken()' \
-	'Fedora Patch100: Update constant to %{constant_version}' \
+	'Fedora Patch100: Update module constant to %{constant_version}' \
 	'Fedora Patch101: Update Archive::Extract to %{Archive_Extract_version}' \
 	'Fedora Patch102: Update Archive::Tar to %{Archive_Tar_version}' \
 	'Fedora Patch103: Update CGI to %{CGI_version}' \
@@ -1248,6 +1252,7 @@
 	'Fedora Patch115: Update Test::Simple to %{Test_Simple_version}' \
 	'Fedora Patch116: Update Time::HiRes to %{Time_HiRes_version}' \
 	'Fedora Patch117: Update Digest::SHA to %{Digest_SHA_version}' \
+	'Fedora Patch117: Update module autodie to %{autodie_version}' \
 	'Fedora Patch201: Fedora uses links instead of lynx' \
 	%{nil}
 
@@ -1870,6 +1875,9 @@
 
 # Old changelog entries are preserved in CVS.
 %changelog
+* Tue Mar 24 2009 Stepan Kasal <skasal at redhat.com> - 4:5.10.0-64
+- update module autodie
+
 * Mon Mar 23 2009 Stepan Kasal <skasal at redhat.com> - 4:5.10.0-63
 - update Digest::SHA (fixes 489221)
 




More information about the fedora-extras-commits mailing list