rpms/perl/F-11 perl-5.10.0-much-better-swap-logic.patch, NONE, 1.1 perl-5.10.0-spamassassin.patch, NONE, 1.1 perl-bz509676.patch, NONE, 1.1 perl-skip-prereq.patch, NONE, 1.1 perl-update-Module-Pluggable.patch, NONE, 1.1 perl-update-Scalar-List-Utils.patch, NONE, 1.1 perl-update-Test-Simple.patch, 1.1, 1.2 perl.spec, 1.219, 1.220
Chris Weyl
cweyl at fedoraproject.org
Fri Sep 18 18:52:12 UTC 2009
Author: cweyl
Update of /cvs/extras/rpms/perl/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv14408
Modified Files:
perl-update-Test-Simple.patch perl.spec
Added Files:
perl-5.10.0-much-better-swap-logic.patch
perl-5.10.0-spamassassin.patch perl-bz509676.patch
perl-skip-prereq.patch perl-update-Module-Pluggable.patch
perl-update-Scalar-List-Utils.patch
Log Message:
* Mon Aug 31 2009 Chris Weyl <cweyl at alumni.drew.edu> - 4:5.10.0-82
- update our Test-Simple update to 0.92 (patch by Iain Arnell), #519417
- update Module-Pluggable to 3.9
perl-5.10.0-much-better-swap-logic.patch:
embed.fnc | 1
embed.h | 2 -
ext/Devel/PPPort/parts/embed.fnc | 1
proto.h | 3 --
regcomp.c | 2 -
regexec.c | 44 +++++++++++++++------------------------
regexp.h | 2 -
t/op/pat.t | 19 +++++++++++++++-
8 files changed, 36 insertions(+), 38 deletions(-)
--- NEW FILE perl-5.10.0-much-better-swap-logic.patch ---
diff -up perl-5.10.0/embed.fnc.much perl-5.10.0/embed.fnc
--- perl-5.10.0/embed.fnc.much 2009-07-27 08:31:33.839374246 +0200
+++ perl-5.10.0/embed.fnc 2009-07-27 08:32:05.322374620 +0200
@@ -1441,7 +1441,6 @@ ERsn |U8* |reghop4 |NN U8 *pos|I32 off|N
#endif
ERsn |U8* |reghopmaybe3 |NN U8 *pos|I32 off|NN const U8 *lim
ERs |char* |find_byclass |NN regexp * prog|NN const regnode *c|NN char *s|NN const char *strend|NULLOK regmatch_info *reginfo
-Es |void |swap_match_buff|NN regexp * prog
Es |void |to_utf8_substr |NN regexp * prog
Es |void |to_byte_substr |NN regexp * prog
ERs |I32 |reg_check_named_buff_matched |NN const regexp *rex|NN const regnode *prog
diff -up perl-5.10.0/embed.h.much perl-5.10.0/embed.h
--- perl-5.10.0/embed.h.much 2007-12-18 11:47:07.000000000 +0100
+++ perl-5.10.0/embed.h 2009-07-27 08:31:34.016378805 +0200
@@ -1426,7 +1426,6 @@
#if defined(PERL_CORE) || defined(PERL_EXT)
#define reghopmaybe3 S_reghopmaybe3
#define find_byclass S_find_byclass
-#define swap_match_buff S_swap_match_buff
#define to_utf8_substr S_to_utf8_substr
#define to_byte_substr S_to_byte_substr
#define reg_check_named_buff_matched S_reg_check_named_buff_matched
@@ -3714,7 +3713,6 @@
#if defined(PERL_CORE) || defined(PERL_EXT)
#define reghopmaybe3 S_reghopmaybe3
#define find_byclass(a,b,c,d,e) S_find_byclass(aTHX_ a,b,c,d,e)
-#define swap_match_buff(a) S_swap_match_buff(aTHX_ a)
#define to_utf8_substr(a) S_to_utf8_substr(aTHX_ a)
#define to_byte_substr(a) S_to_byte_substr(aTHX_ a)
#define reg_check_named_buff_matched(a,b) S_reg_check_named_buff_matched(aTHX_ a,b)
diff -up perl-5.10.0/ext/Devel/PPPort/parts/embed.fnc.much perl-5.10.0/ext/Devel/PPPort/parts/embed.fnc
--- perl-5.10.0/ext/Devel/PPPort/parts/embed.fnc.much 2007-12-18 11:47:07.000000000 +0100
+++ perl-5.10.0/ext/Devel/PPPort/parts/embed.fnc 2009-07-27 08:32:58.859374528 +0200
@@ -1436,7 +1436,6 @@ ERsn |U8* |reghop4 |NN U8 *pos|I32 off|N
#endif
ERsn |U8* |reghopmaybe3 |NN U8 *pos|I32 off|NN const U8 *lim
ERs |char* |find_byclass |NN regexp * prog|NN const regnode *c|NN char *s|NN const char *strend|NULLOK regmatch_info *reginfo
-Es |void |swap_match_buff|NN regexp * prog
Es |void |to_utf8_substr |NN regexp * prog
Es |void |to_byte_substr |NN regexp * prog
ERs |I32 |reg_check_named_buff_matched |NN const regexp *rex|NN const regnode *prog
diff -up perl-5.10.0/pod/perlapi.pod.much perl-5.10.0/pod/perlapi.pod
diff -up perl-5.10.0/pod/perlguts.pod.much perl-5.10.0/pod/perlguts.pod
diff -up perl-5.10.0/proto.h.much perl-5.10.0/proto.h
--- perl-5.10.0/proto.h.much 2009-07-27 08:31:33.000000000 +0200
+++ perl-5.10.0/proto.h 2009-07-27 08:35:52.103374484 +0200
@@ -3851,9 +3851,6 @@ STATIC char* S_find_byclass(pTHX_ regexp
__attribute__nonnull__(pTHX_3)
__attribute__nonnull__(pTHX_4);
-STATIC void S_swap_match_buff(pTHX_ regexp * prog)
- __attribute__nonnull__(pTHX_1);
-
STATIC void S_to_utf8_substr(pTHX_ regexp * prog)
__attribute__nonnull__(pTHX_1);
diff -up perl-5.10.0/regcomp.c.much perl-5.10.0/regcomp.c
--- perl-5.10.0/regcomp.c.much 2009-07-27 08:31:33.000000000 +0200
+++ perl-5.10.0/regcomp.c 2009-07-27 08:37:09.598625044 +0200
@@ -9167,7 +9167,6 @@ Perl_pregfree(pTHX_ struct regexp *r)
if (r->saved_copy)
SvREFCNT_dec(r->saved_copy);
#endif
- Safefree(r->swap);
Safefree(r->offs);
Safefree(r);
}
@@ -9216,7 +9215,6 @@ Perl_reg_temp_copy (pTHX_ struct regexp
ret->saved_copy = NULL;
#endif
ret->mother_re = r;
- ret->swap = NULL;
return ret;
}
diff -up perl-5.10.0/regexec.c.much perl-5.10.0/regexec.c
--- perl-5.10.0/regexec.c.much 2007-12-18 11:47:08.000000000 +0100
+++ perl-5.10.0/regexec.c 2009-07-27 08:40:15.966404877 +0200
@@ -1718,26 +1718,6 @@ S_find_byclass(pTHX_ regexp * prog, cons
return s;
}
-static void
-S_swap_match_buff (pTHX_ regexp *prog) {
- regexp_paren_pair *t;
-
- if (!prog->swap) {
- /* We have to be careful. If the previous successful match
- was from this regex we don't want a subsequent paritally
- successful match to clobber the old results.
- So when we detect this possibility we add a swap buffer
- to the re, and switch the buffer each match. If we fail
- we switch it back, otherwise we leave it swapped.
- */
- Newxz(prog->swap, (prog->nparens + 1), regexp_paren_pair);
- }
- t = prog->swap;
- prog->swap = prog->offs;
- prog->offs = t;
-}
-
-
/*
- regexec_flags - match a regexp against a string
*/
@@ -1765,7 +1745,7 @@ Perl_regexec_flags(pTHX_ REGEXP * const
I32 multiline;
RXi_GET_DECL(prog,progi);
regmatch_info reginfo; /* create some info to pass to regtry etc */
- bool swap_on_fail = 0;
+ regexp_paren_pair *swap = NULL;
GET_RE_DEBUG_FLAGS_DECL;
@@ -1843,9 +1823,16 @@ Perl_regexec_flags(pTHX_ REGEXP * const
reginfo.ganch = strbeg;
}
if (PL_curpm && (PM_GETRE(PL_curpm) == prog)) {
- swap_on_fail = 1;
- swap_match_buff(prog); /* do we need a save destructor here for
- eval dies? */
+ /* We have to be careful. If the previous successful match
+ was from this regex we don't want a subsequent partially
+ successful match to clobber the old results.
+ So when we detect this possibility we add a swap buffer
+ to the re, and switch the buffer each match. If we fail
+ we switch it back, otherwise we leave it swapped.
+ */
+ swap = prog->offs;
+ /* do we need a save destructor here for eval dies? */
+ Newxz(prog->offs, (prog->nparens + 1), regexp_paren_pair);
}
if (!(flags & REXEC_CHECKED) && (prog->check_substr != NULL || prog->check_utf8 != NULL)) {
re_scream_pos_data d;
@@ -2144,6 +2131,7 @@ Perl_regexec_flags(pTHX_ REGEXP * const
goto phooey;
got_it:
+ Safefree(swap);
RX_MATCH_TAINTED_set(prog, PL_reg_flags & RF_tainted);
if (PL_reg_eval_set)
@@ -2189,10 +2177,12 @@ phooey:
PL_colors[4], PL_colors[5]));
if (PL_reg_eval_set)
restore_pos(aTHX_ prog);
- if (swap_on_fail)
+ if (swap) {
/* we failed :-( roll it back */
- swap_match_buff(prog);
-
+ Safefree(prog->offs);
+ prog->offs = swap;
+ }
+
return 0;
}
diff -up perl-5.10.0/regexp.h.much perl-5.10.0/regexp.h
--- perl-5.10.0/regexp.h.much 2007-12-18 11:47:08.000000000 +0100
+++ perl-5.10.0/regexp.h 2009-07-27 08:41:06.882374786 +0200
@@ -88,7 +88,7 @@ typedef struct regexp {
/* Data about the last/current match. These are modified during matching*/
U32 lastparen; /* last open paren matched */
U32 lastcloseparen; /* last close paren matched */
- regexp_paren_pair *swap; /* Swap copy of *offs */
+ regexp_paren_pair *swap; /* Unused: 5.10.1 and later */
regexp_paren_pair *offs; /* Array of offsets for (@-) and (@+) */
char *subbeg; /* saved or original string
diff -up perl-5.10.0/t/op/pat.t.much perl-5.10.0/t/op/pat.t
--- perl-5.10.0/t/op/pat.t.much 2007-12-18 11:47:08.000000000 +0100
+++ perl-5.10.0/t/op/pat.t 2009-07-27 08:44:50.343375513 +0200
@@ -4558,10 +4558,27 @@ ok($@=~/\QSequence \k... not terminated
ok("aaa" =~ /$s/, "#45337");
}
+# This only works under -DEBUGGING because it relies on an assert().
+{
+ local $BugId = '60508';
+ local $Message = "Check capture offset re-entrancy of utf8 code.";
+
+ sub fswash { $_[0] =~ s/([>X])//g; }
+ my $k1 = "." x 4 . ">>";
+ fswash($k1);
+
+ my $k2 = "\x{f1}\x{2022}";
+ $k2 =~ s/([\360-\362])/>/g;
+ fswash($k2);
+
+ iseq($k2, "\x{2022}", "utf8::SWASHNEW doesn't cause capture leaks");
+}
+
# Put new tests above the dotted line about a page above this comment
iseq(0+$::test,$::TestCount,"Got the right number of tests!");
# Don't forget to update this!
BEGIN {
- $::TestCount = 4013;
+ $::TestCount = 4014;
print "1..$::TestCount\n";
}
+
perl-5.10.0-spamassassin.patch:
Basename.pm | 1 +
1 file changed, 1 insertion(+)
--- NEW FILE perl-5.10.0-spamassassin.patch ---
diff -up perl-5.10.0/lib/File/Basename.pm.spam perl-5.10.0/lib/File/Basename.pm
--- perl-5.10.0/lib/File/Basename.pm.spam 2009-07-27 08:45:18.000000000 +0200
+++ perl-5.10.0/lib/File/Basename.pm 2009-07-28 09:01:54.757410886 +0200
@@ -331,6 +331,7 @@ sub dirname {
sub _strip_trailing_sep {
my $type = $Fileparse_fstype;
+ local $1;
if ($type eq 'MacOS') {
$_[0] =~ s/([^:]):\z/$1/s;
}
perl-bz509676.patch:
lib/h2ph.t | 10 +++++++++-
t/lib/h2ph.h | 6 ++++++
t/lib/h2ph.pht | 24 ++++++++++++++----------
utils/h2ph.PL | 2 +-
4 files changed, 30 insertions(+), 12 deletions(-)
--- NEW FILE perl-bz509676.patch ---
commit 345d607e7958b7f31d5f0c780e86d1cc3e658d99
Author: Niko Tyni <ntyni at debian.org>
Date: Tue Apr 14 22:55:34 2009 +0300
Squelch 'Constant subroutine ... undefined' warnings from .ph files
As reported by Christopher Zimmermann in <http://bugs.debian.org/379757>,
code generated from simple #undef directives by h2ph can cause
'Constant subroutine ... undefined' warnings if the undefined
function was eligible for inlining.
(cherry picked from commit c0cc52e96e988526754ef533bd76595720660db2)
commit 2d375d52dd1895b26a80209dd64a3c11b9e3b532
Author: Niko Tyni <ntyni at debian.org>
Date: Tue Apr 14 22:55:33 2009 +0300
Add tests to verify that h2ph output compiles and is warning free
The #include directives are #ifdef'd out so that running the
resulting code does not actually need the headers. We still
get the same effect from comparing with the expected h2ph output.
(cherry picked from commit c1a2df7619e7315b8fccef3b9fa56bb8d7df3845)
diff --git a/lib/h2ph.t b/lib/h2ph.t
index 7b339b3..e303406 100755
--- a/lib/h2ph.t
+++ b/lib/h2ph.t
@@ -15,7 +15,7 @@ if (!(-e $extracted_program)) {
exit 0;
}
-print "1..2\n";
+print "1..4\n";
# quickly compare two text files
sub txt_compare {
@@ -32,6 +32,14 @@ print(($ok == 0 ? "" : "not "), "ok 1\n");
$ok = txt_compare("lib/h2ph.ph", "lib/h2ph.pht");
print(($ok == 0 ? "" : "not "), "ok 2\n");
+# does the output compile?
+$ok = system($^X, "-I../lib", "lib/h2ph.pht");
+print(($ok == 0 ? "" : "not "), "ok 3\n");
+
+# is the output warning free?
+$ok = system($^X, "-w", "-I../lib", "-e", '$SIG{__WARN__} = sub { die $_[0] }; require "lib/h2ph.pht"');
+print(($ok == 0 ? "" : "not "), "ok 4\n");
+
# cleanup - should this be in an END block?
unlink("lib/h2ph.ph");
unlink("_h2ph_pre.ph");
diff --git a/t/lib/h2ph.h b/t/lib/h2ph.h
index 495789a..78429ca 100644
--- a/t/lib/h2ph.h
+++ b/t/lib/h2ph.h
@@ -26,6 +26,10 @@
#undef MAX
#define MAX(a,b) ((a) > (b) ? (a) : (b))
+/* Test #undef'ining an existing constant function */
+#define NOTTRUE 0
+#undef NOTTRUE
+
/* Test #ifdef */
#ifdef __SOME_UNIMPORTANT_PROPERTY
#define MIN(a,b) ((a) < (b) ? (a) : (b))
@@ -68,9 +72,11 @@ function Tru64_Pascal(n: Integer): Integer;
* with `use lib qw(/opt/perl5/lib/site_perl/i586-linux/linux);' or whatever
* your equivalent is...
*/
+#if 0
#include <sys/socket.h>
#import "sys/ioctl.h"
#include_next <sys/fcntl.h>
+#endif
/* typedefs should be ignored */
typedef struct a_struct {
diff --git a/t/lib/h2ph.pht b/t/lib/h2ph.pht
index 145e682..3723fca 100644
--- a/t/lib/h2ph.pht
+++ b/t/lib/h2ph.pht
@@ -1,6 +1,6 @@
require '_h2ph_pre.ph';
-no warnings 'redefine';
+no warnings qw(redefine misc);
unless(defined(&SQUARE)) {
sub SQUARE {
@@ -22,6 +22,8 @@ unless(defined(&_H2PH_H_)) {
my($a,$b) = @_;
eval q((($a) > ($b) ? ($a) : ($b)));
}' unless defined(&MAX);
+ eval 'sub NOTTRUE () {0;}' unless defined(&NOTTRUE);
+ undef(&NOTTRUE) if defined(&NOTTRUE);
if(defined(&__SOME_UNIMPORTANT_PROPERTY)) {
eval 'sub MIN {
my($a,$b) = @_;
@@ -47,15 +49,17 @@ unless(defined(&_H2PH_H_)) {
} else {
eval 'sub WHATEVER () {1000;}' unless defined(&WHATEVER);
}
- require 'sys/socket.ph';
- require 'sys/ioctl.ph';
- eval {
- my(@REM);
- my(%INCD) = map { $INC{$_} => 1 } (grep { $_ eq "sys/fcntl.ph" } keys(%INC));
- @REM = map { "$_/sys/fcntl.ph" } (grep { not exists($INCD{"$_/sys/fcntl.ph"}) and -f "$_/sys/fcntl.ph" } @INC);
- require "$REM[0]" if @REM;
- };
- warn($@) if $@;
+ if(0) {
+ require 'sys/socket.ph';
+ require 'sys/ioctl.ph';
+ eval {
+ my(@REM);
+ my(%INCD) = map { $INC{$_} => 1 } (grep { $_ eq "sys/fcntl.ph" } keys(%INC));
+ @REM = map { "$_/sys/fcntl.ph" } (grep { not exists($INCD{"$_/sys/fcntl.ph"}) and -f "$_/sys/fcntl.ph" } @INC);
+ require "$REM[0]" if @REM;
+ };
+ warn($@) if $@;
+ }
eval("sub sun () { 0; }") unless defined(&sun);
eval("sub mon () { 1; }") unless defined(&mon);
eval("sub tue () { 2; }") unless defined(&tue);
diff --git a/utils/h2ph.PL b/utils/h2ph.PL
index 6f40126..4e99a7a 100644
--- a/utils/h2ph.PL
+++ b/utils/h2ph.PL
@@ -123,7 +123,7 @@ while (defined (my $file = next_file())) {
print OUT
"require '_h2ph_pre.ph';\n\n",
- "no warnings 'redefine';\n\n";
+ "no warnings qw(redefine misc);\n\n";
while (defined (local $_ = next_line($file))) {
if (s/^\s*\#\s*//) {
perl-skip-prereq.patch:
Makefile.PL | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
--- NEW FILE perl-skip-prereq.patch ---
--- perl-5.10.0/ext/Math/BigInt/FastCalc/Makefile.PL 2007-12-18 11:47:07.000000000 +0100
+++ perl-5.10.0/ext/Math/BigInt/FastCalc/Makefile.PL 2009-07-10 15:37:39.000000000 +0200
@@ -2,12 +2,18 @@
use strict;
+unless($ENV{PERL_CORE}) {
+ $ENV{PERL_CORE} = 1 if grep { $_ eq 'PERL_CORE=1' } @ARGV;
+}
+
WriteMakefile(
'NAME' => 'Math::BigInt::FastCalc',
'VERSION_FROM' => 'FastCalc.pm',
- 'PREREQ_PM' => {
- 'Math::BigInt' => 1.88,
- },
+ (
+ $ENV{PERL_CORE}
+ ? ( )
+ : ('PREREQ_PM' => { 'Math::BigInt' => 1.88, } )
+ ),
INSTALLDIRS => 'perl',
PREREQ_FATAL => 1,
MAN3PODS => {},
perl-update-Module-Pluggable.patch:
MANIFEST | 11 +
lib/Devel/InnerPackage.pm | 4
lib/Module/Pluggable.pm | 15 +-
lib/Module/Pluggable/Object.pm | 134 +++++++++++++-------
t/Module_Pluggable/02alsoworks.t | 2
t/Module_Pluggable/02works.t | 2
t/Module_Pluggable/03diffname.t | 2
t/Module_Pluggable/04acmedir.t | 2
t/Module_Pluggable/04acmedir_single.t | 2
t/Module_Pluggable/04acmepath.t | 2
t/Module_Pluggable/04acmepath_single.t | 2
t/Module_Pluggable/05postpath.t | 2
t/Module_Pluggable/06multipath.t | 2
t/Module_Pluggable/07instantiate.t | 4
t/Module_Pluggable/08nothing.t | 2
t/Module_Pluggable/09require.t | 2
t/Module_Pluggable/10innerpack.t | 2
t/Module_Pluggable/10innerpack_inner.t | 2
t/Module_Pluggable/10innerpack_noinner.t | 2
t/Module_Pluggable/10innerpack_onefile.t | 27 ++++
t/Module_Pluggable/10innerpack_override.t | 2
t/Module_Pluggable/10innerpack_super.t | 29 ++++
t/Module_Pluggable/11usetwice.t | 2
t/Module_Pluggable/12only.t | 2
t/Module_Pluggable/12onlyarray.t | 2
t/Module_Pluggable/12onlyregex.t | 2
t/Module_Pluggable/12onlyrequire.t | 21 +++
t/Module_Pluggable/13except.t | 2
t/Module_Pluggable/13exceptarray.t | 4
t/Module_Pluggable/13exceptregex.t | 4
t/Module_Pluggable/14package.t | 2
t/Module_Pluggable/15topicsafe.t | 2
t/Module_Pluggable/16different_extension.t | 2
t/Module_Pluggable/17devel_inner_package.t | 2
t/Module_Pluggable/18skipped_package.t | 2
t/Module_Pluggable/19can_ok_clobber.t | 2
t/Module_Pluggable/20dodgy_files.t | 16 +-
t/Module_Pluggable/21editor_junk.t | 53 +++++++
t/Module_Pluggable/lib/Acme/Foo-Bar.pm | 6
t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm | 9 +
t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm.swo | 9 +
t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm.swp | 9 +
t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm~ | 9 +
t/Module_Pluggable/lib/EditorJunk/Plugin/Foo.pm | 9 +
44 files changed, 344 insertions(+), 81 deletions(-)
--- NEW FILE perl-update-Module-Pluggable.patch ---
This patch is derived from the perl-5.10.1 tarball as released on the CPAN.
diff -urN perl-5.10.0.orig/lib/Devel/InnerPackage.pm perl-5.10.0/lib/Devel/InnerPackage.pm
--- perl-5.10.0.orig/lib/Devel/InnerPackage.pm 2007-12-18 02:47:07.000000000 -0800
+++ perl-5.10.0/lib/Devel/InnerPackage.pm 2009-08-31 19:47:24.444773931 -0700
@@ -17,7 +17,7 @@
=head1 SYNOPSIS
use Foo::Bar;
- use Devel::innerPackage qw(list_packages);
+ use Devel::InnerPackage qw(list_packages);
my @inner_packages = list_packages('Foo::Bar');
@@ -75,7 +75,7 @@
!__PACKAGE__->_loaded($pack.$cand); # or @children;
push @packs, @children;
}
- return grep {$_ !~ /::::ISA::CACHE/} @packs;
+ return grep {$_ !~ /::(::ISA::CACHE|SUPER)/} @packs;
}
### XXX this is an inlining of the Class-Inspector->loaded()
diff -urN perl-5.10.0.orig/lib/Module/Pluggable/Object.pm perl-5.10.0/lib/Module/Pluggable/Object.pm
--- perl-5.10.0.orig/lib/Module/Pluggable/Object.pm 2007-12-18 02:47:07.000000000 -0800
+++ perl-5.10.0/lib/Module/Pluggable/Object.pm 2009-08-31 19:47:24.446771196 -0700
@@ -6,10 +6,9 @@
use File::Spec::Functions qw(splitdir catdir curdir catfile abs2rel);
use Carp qw(croak carp);
use Devel::InnerPackage;
-use Data::Dumper;
use vars qw($VERSION);
-$VERSION = '3.6';
+$VERSION = '3.9';
sub new {
@@ -20,6 +19,10 @@
}
+### Eugggh, this code smells
+### This is what happens when you keep adding patches
+### *sigh*
+
sub plugins {
my $self = shift;
@@ -30,14 +33,14 @@
my $filename = $self->{'filename'};
my $pkg = $self->{'package'};
+ # Get the exception params instantiated
+ $self->_setup_exceptions;
+
# automatically turn a scalar search path or namespace into a arrayref
for (qw(search_path search_dirs)) {
$self->{$_} = [ $self->{$_} ] if exists $self->{$_} && !ref($self->{$_});
}
-
-
-
# default search path is '<Module>::<Name>::Plugin'
$self->{'search_path'} = ["${pkg}::Plugin"] unless $self->{'search_path'};
@@ -46,13 +49,14 @@
# check to see if we're running under test
- my @SEARCHDIR = exists $INC{"blib.pm"} && $filename =~ m!(^|/)blib/! ? grep {/blib/} @INC : @INC;
+ my @SEARCHDIR = exists $INC{"blib.pm"} && defined $filename && $filename =~ m!(^|/)blib/! ? grep {/blib/} @INC : @INC;
# add any search_dir params
unshift @SEARCHDIR, @{$self->{'search_dirs'}} if defined $self->{'search_dirs'};
my @plugins = $self->search_directories(@SEARCHDIR);
+ push(@plugins, $self->handle_innerpackages($_)) for @{$self->{'search_path'}};
# push @plugins, map { print STDERR "$_\n"; $_->require } list_packages($_) for (@{$self->{'search_path'}});
@@ -60,43 +64,12 @@
return () unless @plugins;
- # exceptions
- my %only;
- my %except;
- my $only;
- my $except;
-
- if (defined $self->{'only'}) {
- if (ref($self->{'only'}) eq 'ARRAY') {
- %only = map { $_ => 1 } @{$self->{'only'}};
- } elsif (ref($self->{'only'}) eq 'Regexp') {
- $only = $self->{'only'}
- } elsif (ref($self->{'only'}) eq '') {
- $only{$self->{'only'}} = 1;
- }
- }
-
-
- if (defined $self->{'except'}) {
- if (ref($self->{'except'}) eq 'ARRAY') {
- %except = map { $_ => 1 } @{$self->{'except'}};
- } elsif (ref($self->{'except'}) eq 'Regexp') {
- $except = $self->{'except'}
- } elsif (ref($self->{'except'}) eq '') {
- $except{$self->{'except'}} = 1;
- }
- }
-
# remove duplicates
# probably not necessary but hey ho
my %plugins;
for(@plugins) {
- next if (keys %only && !$only{$_} );
- next unless (!defined $only || m!$only! );
-
- next if (keys %except && $except{$_} );
- next if (defined $except && m!$except! );
+ next unless $self->_is_legit($_);
$plugins{$_} = 1;
}
@@ -112,6 +85,58 @@
}
+sub _setup_exceptions {
+ my $self = shift;
+
+ my %only;
+ my %except;
+ my $only;
+ my $except;
+
+ if (defined $self->{'only'}) {
+ if (ref($self->{'only'}) eq 'ARRAY') {
+ %only = map { $_ => 1 } @{$self->{'only'}};
+ } elsif (ref($self->{'only'}) eq 'Regexp') {
+ $only = $self->{'only'}
+ } elsif (ref($self->{'only'}) eq '') {
+ $only{$self->{'only'}} = 1;
+ }
+ }
+
+
+ if (defined $self->{'except'}) {
+ if (ref($self->{'except'}) eq 'ARRAY') {
+ %except = map { $_ => 1 } @{$self->{'except'}};
+ } elsif (ref($self->{'except'}) eq 'Regexp') {
+ $except = $self->{'except'}
+ } elsif (ref($self->{'except'}) eq '') {
+ $except{$self->{'except'}} = 1;
+ }
+ }
+ $self->{_exceptions}->{only_hash} = \%only;
+ $self->{_exceptions}->{only} = $only;
+ $self->{_exceptions}->{except_hash} = \%except;
+ $self->{_exceptions}->{except} = $except;
+
+}
+
+sub _is_legit {
+ my $self = shift;
+ my $plugin = shift;
+ my %only = %{$self->{_exceptions}->{only_hash}||{}};
+ my %except = %{$self->{_exceptions}->{except_hash}||{}};
+ my $only = $self->{_exceptions}->{only};
+ my $except = $self->{_exceptions}->{except};
+
+ return 0 if (keys %only && !$only{$plugin} );
+ return 0 unless (!defined $only || $plugin =~ m!$only! );
+
+ return 0 if (keys %except && $except{$plugin} );
+ return 0 if (defined $except && $plugin =~ m!$except! );
+
+ return 1;
+}
+
sub search_directories {
my $self = shift;
my @SEARCHDIR = @_;
@@ -121,7 +146,6 @@
foreach my $dir (@SEARCHDIR) {
push @plugins, $self->search_paths($dir);
}
-
return @plugins;
}
@@ -151,6 +175,8 @@
# parse the file to get the name
my ($name, $directory, $suffix) = fileparse($file, $file_regex);
+ next if (!$self->{include_editor_junk} && $self->_is_editor_junk($name));
+
$directory = abs2rel($directory, $sp);
# If we have a mixed-case package name, assume case has been preserved
@@ -203,17 +229,34 @@
# now add stuff that may have been in package
# NOTE we should probably use all the stuff we've been given already
# but then we can't unload it :(
- push @plugins, $self->handle_innerpackages($searchpath) unless (exists $self->{inner} && !$self->{inner});
+ push @plugins, $self->handle_innerpackages($searchpath);
} # foreach $searchpath
return @plugins;
}
+sub _is_editor_junk {
+ my $self = shift;
+ my $name = shift;
+
+ # Emacs (and other Unix-y editors) leave temp files ending in a
+ # tilde as a backup.
+ return 1 if $name =~ /~$/;
+ # Emacs makes these files while a buffer is edited but not yet
+ # saved.
+ return 1 if $name =~ /^\.#/;
+ # Vim can leave these files behind if it crashes.
+ return 1 if $name =~ /\.sw[po]$/;
+
+ return 0;
+}
+
sub handle_finding_plugin {
my $self = shift;
my $plugin = shift;
return unless (defined $self->{'instantiate'} || $self->{'require'});
+ return unless $self->_is_legit($plugin);
$self->_require($plugin);
}
@@ -245,10 +288,11 @@
sub handle_innerpackages {
my $self = shift;
+ return () if (exists $self->{inner} && !$self->{inner});
+
my $path = shift;
my @plugins;
-
foreach my $plugin (Devel::InnerPackage::list_packages($path)) {
my $err = $self->handle_finding_plugin($plugin);
#next if $err;
@@ -299,6 +343,14 @@
Optionally it instantiates those classes for you.
+This object is wrapped by C<Module::Pluggable>. If you want to do something
+odd or add non-general special features you're probably best to wrap this
+and produce your own subclass.
+
+=head1 OPTIONS
+
+See the C<Module::Pluggable> docs.
+
=head1 AUTHOR
Simon Wistow <simon at thegestalt.org>
diff -urN perl-5.10.0.orig/lib/Module/Pluggable.pm perl-5.10.0/lib/Module/Pluggable.pm
--- perl-5.10.0.orig/lib/Module/Pluggable.pm 2007-12-18 02:47:07.000000000 -0800
+++ perl-5.10.0/lib/Module/Pluggable.pm 2009-08-31 19:47:24.448771465 -0700
@@ -9,7 +9,7 @@
# Peter Gibbons: I wouldn't say I've been missing it, Bob!
-$VERSION = '3.6';
+$VERSION = '3.9';
sub import {
my $class = shift;
@@ -60,8 +60,9 @@
no strict 'refs';
- no warnings 'redefine';
- *{"$package\::$sub"} = $subroutine;
+ no warnings qw(redefine prototype);
+
+ *{"$package\::$sub"} = $subroutine;
*{"$package\::search_path"} = $searchsub;
*{"$package\::only"} = $onlysub;
*{"$package\::except"} = $exceptsub;
@@ -297,6 +298,14 @@
file_regex => qr/\.plugin$/
+=head2 include_editor_junk
+
+By default C<Module::Pluggable> ignores files that look like they were
+left behind by editors. Currently this means files ending in F<~> (~),
+the extensions F<.swp> or F<.swo>, or files beginning with F<.#>.
+
+Setting C<include_editor_junk> changes C<Module::Pluggable> so it does
+not ignore any files it finds.
=head1 METHODs
diff -urN perl-5.10.0.orig/MANIFEST perl-5.10.0/MANIFEST
--- perl-5.10.0.orig/MANIFEST 2007-12-18 02:47:07.000000000 -0800
+++ perl-5.10.0/MANIFEST 2009-08-31 19:47:24.452770885 -0700
@@ -3612,11 +3612,14 @@
t/Module_Pluggable/09require.t Module::Pluggable tests
t/Module_Pluggable/10innerpack_inner.t Module::Pluggable tests
t/Module_Pluggable/10innerpack_noinner.t Module::Pluggable tests
+t/Module_Pluggable/10innerpack_onefile.t Module::Pluggable tests
t/Module_Pluggable/10innerpack_override.t Module::Pluggable tests
+t/Module_Pluggable/10innerpack_super.t Module::Pluggable tests
t/Module_Pluggable/10innerpack.t Module::Pluggable tests
t/Module_Pluggable/11usetwice.t Module::Pluggable tests
t/Module_Pluggable/12onlyarray.t Module::Pluggable tests
t/Module_Pluggable/12onlyregex.t Module::Pluggable tests
+t/Module_Pluggable/12onlyrequire.t Module::Pluggable tests
t/Module_Pluggable/12only.t Module::Pluggable tests
t/Module_Pluggable/13exceptarray.t Module::Pluggable tests
t/Module_Pluggable/13exceptregex.t Module::Pluggable tests
@@ -3628,8 +3631,15 @@
t/Module_Pluggable/18skipped_package.t Module::Pluggable tests
t/Module_Pluggable/19can_ok_clobber.t Module::Pluggable tests
t/Module_Pluggable/20dodgy_files.t Module::Pluggable tests
+t/Module_Pluggable/21editor_junk.t Module::Pluggable tests
t/Module_Pluggable/acme/Acme/MyTest/Plugin/Foo.pm Module::Pluggable tests
t/Module_Pluggable/lib/Acme/MyTest/Plugin/Foo.pm Module::Pluggable tests
+t/Module_Pluggable/lib/Acme/Foo-Bar.pm Module::Pluggable tests
+t/Module_Pluggable/lib/EditorJunk/Plugin/Foo.pm Module::Pluggable tests
+t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm.swo Module::Pluggable tests
+t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm.swp Module::Pluggable tests
+t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm~ Module::Pluggable tests
+t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm Module::Pluggable tests
t/Module_Pluggable/lib/ExtTest/Plugin/Bar.plugin Module::Pluggable tests
t/Module_Pluggable/lib/ExtTest/Plugin/Foo.plugin Module::Pluggable tests
t/Module_Pluggable/lib/ExtTest/Plugin/Quux/Foo.plugin Module::Pluggable tests
@@ -3646,6 +3656,7 @@
t/Module_Pluggable/lib/OddTest/Plugin/-Dodgy.pm Module::Pluggable tests
t/Module_Pluggable/lib/OddTest/Plugin/Foo.pm Module::Pluggable tests
t/Module_Pluggable/lib/TA/C/A/I.pm Module::Pluggable tests
+t/Module_Pluggable/lib/Zot/.Zork.pm Module::Pluggable tests
t/mro/basic_01_c3.t mro tests
t/mro/basic_01_dfs.t mro tests
t/mro/basic_02_c3.t mro tests
diff -urN perl-5.10.0.orig/t/Module_Pluggable/02alsoworks.t perl-5.10.0/t/Module_Pluggable/02alsoworks.t
--- perl-5.10.0.orig/t/Module_Pluggable/02alsoworks.t 2007-12-18 02:47:08.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/02alsoworks.t 2009-08-31 19:47:24.454770805 -0700
@@ -2,7 +2,7 @@
use strict;
use FindBin;
-use lib "$FindBin::Bin/lib";
+use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
use Test::More tests => 5;
my $foo;
diff -urN perl-5.10.0.orig/t/Module_Pluggable/02works.t perl-5.10.0/t/Module_Pluggable/02works.t
--- perl-5.10.0.orig/t/Module_Pluggable/02works.t 2007-12-18 02:47:08.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/02works.t 2009-08-31 19:47:24.455771358 -0700
@@ -2,7 +2,7 @@
use strict;
use FindBin;
-use lib "$FindBin::Bin/lib";
+use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
use Test::More tests => 5;
my $foo;
diff -urN perl-5.10.0.orig/t/Module_Pluggable/03diffname.t perl-5.10.0/t/Module_Pluggable/03diffname.t
--- perl-5.10.0.orig/t/Module_Pluggable/03diffname.t 2007-12-18 02:47:08.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/03diffname.t 2009-08-31 19:47:24.456771493 -0700
@@ -2,7 +2,7 @@
use strict;
use FindBin;
-use lib "$FindBin::Bin/lib";
+use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
use Test::More tests => 3;
my $foo;
diff -urN perl-5.10.0.orig/t/Module_Pluggable/04acmedir_single.t perl-5.10.0/t/Module_Pluggable/04acmedir_single.t
--- perl-5.10.0.orig/t/Module_Pluggable/04acmedir_single.t 2007-12-18 02:47:08.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/04acmedir_single.t 2009-08-31 19:47:24.456771493 -0700
@@ -2,7 +2,7 @@
use strict;
use FindBin;
-use lib "$FindBin::Bin/lib";
+use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
use Test::More tests => 3;
diff -urN perl-5.10.0.orig/t/Module_Pluggable/04acmedir.t perl-5.10.0/t/Module_Pluggable/04acmedir.t
--- perl-5.10.0.orig/t/Module_Pluggable/04acmedir.t 2007-12-18 02:47:08.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/04acmedir.t 2009-08-31 19:47:24.457771627 -0700
@@ -2,7 +2,7 @@
use strict;
use FindBin;
-use lib "$FindBin::Bin/lib";
+use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
use Test::More tests => 3;
diff -urN perl-5.10.0.orig/t/Module_Pluggable/04acmepath_single.t perl-5.10.0/t/Module_Pluggable/04acmepath_single.t
--- perl-5.10.0.orig/t/Module_Pluggable/04acmepath_single.t 2007-12-18 02:47:08.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/04acmepath_single.t 2009-08-31 19:47:24.458773508 -0700
@@ -2,7 +2,7 @@
use strict;
use FindBin;
-use lib "$FindBin::Bin/lib";
+use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
use Test::More tests => 3;
diff -urN perl-5.10.0.orig/t/Module_Pluggable/04acmepath.t perl-5.10.0/t/Module_Pluggable/04acmepath.t
--- perl-5.10.0.orig/t/Module_Pluggable/04acmepath.t 2007-12-18 02:47:08.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/04acmepath.t 2009-08-31 19:47:24.459772105 -0700
@@ -2,7 +2,7 @@
use strict;
use FindBin;
-use lib "$FindBin::Bin/lib";
+use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
use Test::More tests => 3;
diff -urN perl-5.10.0.orig/t/Module_Pluggable/05postpath.t perl-5.10.0/t/Module_Pluggable/05postpath.t
--- perl-5.10.0.orig/t/Module_Pluggable/05postpath.t 2007-12-18 02:47:08.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/05postpath.t 2009-08-31 19:47:24.460771332 -0700
@@ -2,7 +2,7 @@
use strict;
use FindBin;
-use lib "$FindBin::Bin/lib";
+use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
use Test::More tests => 3;
diff -urN perl-5.10.0.orig/t/Module_Pluggable/06multipath.t perl-5.10.0/t/Module_Pluggable/06multipath.t
--- perl-5.10.0.orig/t/Module_Pluggable/06multipath.t 2007-12-18 02:47:08.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/06multipath.t 2009-08-31 19:47:24.461771676 -0700
@@ -2,7 +2,7 @@
use strict;
use FindBin;
-use lib "$FindBin::Bin/lib";
+use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
use Test::More tests => 3;
diff -urN perl-5.10.0.orig/t/Module_Pluggable/07instantiate.t perl-5.10.0/t/Module_Pluggable/07instantiate.t
--- perl-5.10.0.orig/t/Module_Pluggable/07instantiate.t 2007-12-18 02:47:08.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/07instantiate.t 2009-08-31 19:47:24.462772090 -0700
@@ -2,7 +2,7 @@
use strict;
use FindBin;
-use lib "$FindBin::Bin/lib";
+use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
use Test::More tests => 6;
my $foo;
@@ -26,7 +26,7 @@
use File::Spec::Functions qw(catdir);
use strict;
use FindBin;
-use lib "$FindBin::Bin/lib";
+use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
use Module::Pluggable (search_path => ["MyTest::Extend::Plugin"], sub_name => 'booga', instantiate => 'new');
use Module::Pluggable (search_path => ["MyTest::Extend::Plugin"], sub_name => 'wooga', instantiate => 'nosomuchmethod');
diff -urN perl-5.10.0.orig/t/Module_Pluggable/08nothing.t perl-5.10.0/t/Module_Pluggable/08nothing.t
--- perl-5.10.0.orig/t/Module_Pluggable/08nothing.t 2007-12-18 02:47:08.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/08nothing.t 2009-08-31 19:47:24.463771316 -0700
@@ -2,7 +2,7 @@
use strict;
use FindBin;
-use lib "$FindBin::Bin/lib";
+use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
use Test::More tests => 2;
diff -urN perl-5.10.0.orig/t/Module_Pluggable/09require.t perl-5.10.0/t/Module_Pluggable/09require.t
--- perl-5.10.0.orig/t/Module_Pluggable/09require.t 2007-12-18 02:47:08.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/09require.t 2009-08-31 19:47:24.464771800 -0700
@@ -2,7 +2,7 @@
use strict;
use FindBin;
-use lib "$FindBin::Bin/lib";
+use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
use Test::More tests => 2;
my $t = MyTest->new();
diff -urN perl-5.10.0.orig/t/Module_Pluggable/10innerpack_inner.t perl-5.10.0/t/Module_Pluggable/10innerpack_inner.t
--- perl-5.10.0.orig/t/Module_Pluggable/10innerpack_inner.t 2007-12-18 02:47:08.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/10innerpack_inner.t 2009-08-31 19:47:24.465771515 -0700
@@ -2,7 +2,7 @@
use strict;
use FindBin;
-use lib "$FindBin::Bin/lib";
+use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
use Test::More tests => 3;
diff -urN perl-5.10.0.orig/t/Module_Pluggable/10innerpack_noinner.t perl-5.10.0/t/Module_Pluggable/10innerpack_noinner.t
--- perl-5.10.0.orig/t/Module_Pluggable/10innerpack_noinner.t 2007-12-18 02:47:08.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/10innerpack_noinner.t 2009-08-31 19:47:24.479772629 -0700
@@ -2,7 +2,7 @@
use strict;
use FindBin;
-use lib "$FindBin::Bin/lib";
+use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
use Test::More tests => 3;
diff -urN perl-5.10.0.orig/t/Module_Pluggable/10innerpack_onefile.t perl-5.10.0/t/Module_Pluggable/10innerpack_onefile.t
--- perl-5.10.0.orig/t/Module_Pluggable/10innerpack_onefile.t 1969-12-31 16:00:00.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/10innerpack_onefile.t 2009-08-31 19:47:24.480772134 -0700
@@ -0,0 +1,27 @@
+#!perl -wT
+
+use strict;
+use Test::More tests => 2;
+use Data::Dumper;
+
+my $mc = MyClass->new();
+my $mc2 = MyClass2->new();
+
+
+is_deeply([$mc->plugins], [qw(MyClass::Plugin::MyPlugin)], "Got inner plugin");
+is_deeply([$mc2->plugins], [], "Didn't get plugin");
+
+package MyClass::Plugin::MyPlugin;
+sub pretty { print "I am pretty" };
+
+package MyClass;
+use Module::Pluggable inner => 1;
+
+sub new { return bless {}, $_[0] }
+
+package MyClass2;
+use Module::Pluggable search_path => "MyClass::Plugin", inner => 0;
+
+sub new { return bless {}, $_[0] }
+1;
+
diff -urN perl-5.10.0.orig/t/Module_Pluggable/10innerpack_override.t perl-5.10.0/t/Module_Pluggable/10innerpack_override.t
--- perl-5.10.0.orig/t/Module_Pluggable/10innerpack_override.t 2007-12-18 02:47:08.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/10innerpack_override.t 2009-08-31 19:47:24.481771501 -0700
@@ -2,7 +2,7 @@
use strict;
use FindBin;
-use lib "$FindBin::Bin/lib";
+use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
use Test::More tests => 3;
diff -urN perl-5.10.0.orig/t/Module_Pluggable/10innerpack_super.t perl-5.10.0/t/Module_Pluggable/10innerpack_super.t
--- perl-5.10.0.orig/t/Module_Pluggable/10innerpack_super.t 1969-12-31 16:00:00.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/10innerpack_super.t 2009-08-31 19:47:24.482771565 -0700
@@ -0,0 +1,29 @@
+#!perl -wT
+
+use Test::More tests => 3;
+use strict;
+use_ok('Devel::InnerPackage');
+Bar->whee;
+is_deeply([Devel::InnerPackage::list_packages("Bar")],[], "Don't pick up ::SUPER pseudo stash");
+is_deeply([Devel::InnerPackage::list_packages("Foo")],['Foo::Bar'], "Still pick up other inner package");
+
+package Foo;
+
+sub whee {
+ 1;
+}
+
+package Foo::Bar;
+
+sub whee {}
+
+package Bar;
+use base 'Foo';
+
+sub whee {
+ shift->SUPER::whee;
+ 2;
+}
+
+
+1;
diff -urN perl-5.10.0.orig/t/Module_Pluggable/10innerpack.t perl-5.10.0/t/Module_Pluggable/10innerpack.t
--- perl-5.10.0.orig/t/Module_Pluggable/10innerpack.t 2007-12-18 02:47:08.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/10innerpack.t 2009-08-31 19:47:24.483771909 -0700
@@ -2,7 +2,7 @@
use strict;
use FindBin;
-use lib "$FindBin::Bin/lib";
+use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
use Test::More tests => 4;
diff -urN perl-5.10.0.orig/t/Module_Pluggable/11usetwice.t perl-5.10.0/t/Module_Pluggable/11usetwice.t
--- perl-5.10.0.orig/t/Module_Pluggable/11usetwice.t 2007-12-18 02:47:08.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/11usetwice.t 2009-08-31 19:47:24.484771624 -0700
@@ -2,7 +2,7 @@
use strict;
use FindBin;
-use lib "$FindBin::Bin/lib";
+use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
use Test::More tests => 3;
my $foo;
diff -urN perl-5.10.0.orig/t/Module_Pluggable/12onlyarray.t perl-5.10.0/t/Module_Pluggable/12onlyarray.t
--- perl-5.10.0.orig/t/Module_Pluggable/12onlyarray.t 2007-12-18 02:47:08.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/12onlyarray.t 2009-08-31 19:47:24.485772038 -0700
@@ -2,7 +2,7 @@
use strict;
use FindBin;
-use lib "$FindBin::Bin/lib";
+use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
use Test::More tests => 10;
{
diff -urN perl-5.10.0.orig/t/Module_Pluggable/12onlyregex.t perl-5.10.0/t/Module_Pluggable/12onlyregex.t
--- perl-5.10.0.orig/t/Module_Pluggable/12onlyregex.t 2007-12-18 02:47:08.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/12onlyregex.t 2009-08-31 19:47:24.485772038 -0700
@@ -2,7 +2,7 @@
use strict;
use FindBin;
-use lib "$FindBin::Bin/lib";
+use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
use Test::More tests => 10;
{
diff -urN perl-5.10.0.orig/t/Module_Pluggable/12onlyrequire.t perl-5.10.0/t/Module_Pluggable/12onlyrequire.t
--- perl-5.10.0.orig/t/Module_Pluggable/12onlyrequire.t 1969-12-31 16:00:00.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/12onlyrequire.t 2009-08-31 19:47:24.505021273 -0700
@@ -0,0 +1,21 @@
+#!perl -w
+use strict;
+use FindBin;
+use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
+use Test::More tests => 2;
+
+my @packages = eval { Zot->_dist_types };
+is($@, '', "No warnings");
+is(scalar(@packages), 0, "Correctly only got 1 package");
+
+
+package Zot;
+use strict;
+use Module::Pluggable (
+ sub_name => '_dist_types',
+ search_path => __PACKAGE__,
+ only => qr/Zot::\w+$/,
+ require => 1,
+ );
+
+1;
diff -urN perl-5.10.0.orig/t/Module_Pluggable/12only.t perl-5.10.0/t/Module_Pluggable/12only.t
--- perl-5.10.0.orig/t/Module_Pluggable/12only.t 2007-12-18 02:47:08.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/12only.t 2009-08-31 19:47:24.506022385 -0700
@@ -2,7 +2,7 @@
use strict;
use FindBin;
-use lib "$FindBin::Bin/lib";
+use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
use Test::More tests => 10;
{
diff -urN perl-5.10.0.orig/t/Module_Pluggable/13exceptarray.t perl-5.10.0/t/Module_Pluggable/13exceptarray.t
--- perl-5.10.0.orig/t/Module_Pluggable/13exceptarray.t 2007-12-18 02:47:08.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/13exceptarray.t 2009-08-31 19:47:24.507021263 -0700
@@ -1,8 +1,8 @@
-#!perl -w
+#!perl -wT
use strict;
use FindBin;
-use lib "$FindBin::Bin/lib";
+use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
use Test::More tests => 10;
{
diff -urN perl-5.10.0.orig/t/Module_Pluggable/13exceptregex.t perl-5.10.0/t/Module_Pluggable/13exceptregex.t
--- perl-5.10.0.orig/t/Module_Pluggable/13exceptregex.t 2007-12-18 02:47:08.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/13exceptregex.t 2009-08-31 19:47:24.510021945 -0700
@@ -1,8 +1,8 @@
-#!perl -w
+#!perl -wT
use strict;
use FindBin;
-use lib "$FindBin::Bin/lib";
+use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
use Test::More tests => 10;
{
diff -urN perl-5.10.0.orig/t/Module_Pluggable/13except.t perl-5.10.0/t/Module_Pluggable/13except.t
--- perl-5.10.0.orig/t/Module_Pluggable/13except.t 2007-12-18 02:47:08.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/13except.t 2009-08-31 19:47:24.511021381 -0700
@@ -2,7 +2,7 @@
use strict;
use FindBin;
-use lib "$FindBin::Bin/lib";
+use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
use Test::More tests => 10;
{
diff -urN perl-5.10.0.orig/t/Module_Pluggable/14package.t perl-5.10.0/t/Module_Pluggable/14package.t
--- perl-5.10.0.orig/t/Module_Pluggable/14package.t 2007-12-18 02:47:08.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/14package.t 2009-08-31 19:47:24.842414378 -0700
@@ -2,7 +2,7 @@
use strict;
use FindBin;
-use lib "$FindBin::Bin/lib";
+use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
use Test::More tests => 5;
my $foo;
diff -urN perl-5.10.0.orig/t/Module_Pluggable/15topicsafe.t perl-5.10.0/t/Module_Pluggable/15topicsafe.t
--- perl-5.10.0.orig/t/Module_Pluggable/15topicsafe.t 2007-12-18 02:47:08.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/15topicsafe.t 2009-08-31 19:47:24.842774343 -0700
@@ -2,7 +2,7 @@
use strict;
use FindBin;
-use lib "$FindBin::Bin/lib";
+use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
use Test::More 'no_plan';
use Module::Pluggable search_path => 'Acme::MyTest';
diff -urN perl-5.10.0.orig/t/Module_Pluggable/16different_extension.t perl-5.10.0/t/Module_Pluggable/16different_extension.t
--- perl-5.10.0.orig/t/Module_Pluggable/16different_extension.t 2007-12-18 02:47:08.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/16different_extension.t 2009-08-31 19:47:24.843800947 -0700
@@ -2,7 +2,7 @@
use strict;
use FindBin;
-use lib "$FindBin::Bin/lib";
+use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
use Test::More tests => 5;
my $foo;
diff -urN perl-5.10.0.orig/t/Module_Pluggable/17devel_inner_package.t perl-5.10.0/t/Module_Pluggable/17devel_inner_package.t
--- perl-5.10.0.orig/t/Module_Pluggable/17devel_inner_package.t 2007-12-18 02:47:08.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/17devel_inner_package.t 2009-08-31 19:47:24.843800947 -0700
@@ -3,7 +3,7 @@
use Devel::InnerPackage qw(list_packages);
use FindBin;
-use lib "$FindBin::Bin/lib";
+use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
my @packages;
diff -urN perl-5.10.0.orig/t/Module_Pluggable/18skipped_package.t perl-5.10.0/t/Module_Pluggable/18skipped_package.t
--- perl-5.10.0.orig/t/Module_Pluggable/18skipped_package.t 2007-12-18 02:47:08.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/18skipped_package.t 2009-08-31 19:47:24.844780129 -0700
@@ -2,7 +2,7 @@
use Test::More tests => 1;
use FindBin;
-use lib "$FindBin::Bin/lib";
+use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
use Devel::InnerPackage qw(list_packages);
use No::Middle;
diff -urN perl-5.10.0.orig/t/Module_Pluggable/19can_ok_clobber.t perl-5.10.0/t/Module_Pluggable/19can_ok_clobber.t
--- perl-5.10.0.orig/t/Module_Pluggable/19can_ok_clobber.t 2007-12-18 02:47:08.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/19can_ok_clobber.t 2009-08-31 19:47:24.844780129 -0700
@@ -3,7 +3,7 @@
use warnings;
use Data::Dumper;
use FindBin;
-use lib "$FindBin::Bin/lib";
+use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
use Test::More tests=>5;
diff -urN perl-5.10.0.orig/t/Module_Pluggable/20dodgy_files.t perl-5.10.0/t/Module_Pluggable/20dodgy_files.t
--- perl-5.10.0.orig/t/Module_Pluggable/20dodgy_files.t 2007-12-18 02:47:08.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/20dodgy_files.t 2009-08-31 19:47:24.845769158 -0700
@@ -1,7 +1,7 @@
#!perl -w
BEGIN {
- if ($^O eq 'VMS') {
+ if ($^O eq 'VMS' || $^O eq 'VOS') {
print "1..0 # Skip: can't handle misspelled plugin names\n";
exit;
}
@@ -9,8 +9,18 @@
use strict;
use FindBin;
-use lib "$FindBin::Bin/lib";
-use Test::More tests => 5;
+use Test::More;
+use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
+use File::Spec::Functions qw(catfile);
+
+
+my ($dodgy_file) = (catfile($FindBin::Bin, "lib", "OddTest", "Plugin", "-Dodgy.pm")=~/^(.*)$/);
+unless (-f $dodgy_file) {
+ plan skip_all => "Can't handle misspelled plugin names\n";
+} else {
+ plan tests => 5;
+}
+
my $foo;
ok($foo = OddTest->new());
diff -urN perl-5.10.0.orig/t/Module_Pluggable/21editor_junk.t perl-5.10.0/t/Module_Pluggable/21editor_junk.t
--- perl-5.10.0.orig/t/Module_Pluggable/21editor_junk.t 1969-12-31 16:00:00.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/21editor_junk.t 2009-08-31 19:47:24.845769158 -0700
@@ -0,0 +1,53 @@
+#!perl -w
+
+use Test::More;
+use FindBin;
+use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
+use Module::Pluggable::Object;
+use File::Spec::Functions qw(catfile);
+
+my ($dodgy_file) = (catfile($FindBin::Bin,"lib", "EditorJunk", "Plugin", "#Bar.pm#")=~/^(.*)$/);
+unless (-f $dodgy_file) {
+ plan skip_all => "Can't handle plugin names with octothorpes\n";
+} else {
+ plan tests => 4;
+}
+
+
+
+my $foo;
+ok($foo = EditorJunk->new());
+
+my @plugins;
+my @expected = qw(EditorJunk::Plugin::Bar EditorJunk::Plugin::Foo);
+ok(@plugins = sort $foo->plugins);
+
+is_deeply(\@plugins, \@expected, "is deeply");
+
+
+my $mpo = Module::Pluggable::Object->new(
+ package => 'EditorJunk',
+ filename => __FILE__,
+ include_editor_junk => 1,
+);
+
+ at expected = ('EditorJunk::Plugin::.#Bar', 'EditorJunk::Plugin::Bar', 'EditorJunk::Plugin::Foo');
+ at plugins = sort $mpo->plugins();
+is_deeply(\@plugins, \@expected, "is deeply");
+
+
+
+package EditorJunk;
+
+use strict;
+use Module::Pluggable;
+
+
+sub new {
+ my $class = shift;
+ return bless {}, $class;
+
+}
+1;
+
+
diff -urN perl-5.10.0.orig/t/Module_Pluggable/lib/Acme/Foo-Bar.pm perl-5.10.0/t/Module_Pluggable/lib/Acme/Foo-Bar.pm
--- perl-5.10.0.orig/t/Module_Pluggable/lib/Acme/Foo-Bar.pm 1969-12-31 16:00:00.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/lib/Acme/Foo-Bar.pm 2009-08-31 19:47:24.845769158 -0700
@@ -0,0 +1,6 @@
+package Acme::FooBar;
+
+our $quux = "hello";
+
+1;
+
diff -urN perl-5.10.0.orig/t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm perl-5.10.0/t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm
--- perl-5.10.0.orig/t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm 1969-12-31 16:00:00.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm 2009-08-31 19:47:24.846769084 -0700
@@ -0,0 +1,9 @@
+package EditorJunk::Bar;
+
+
+use strict;
+
+
+1;
+
+
diff -urN perl-5.10.0.orig/t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm~ perl-5.10.0/t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm~
--- perl-5.10.0.orig/t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm~ 1969-12-31 16:00:00.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm~ 2009-08-31 19:47:24.851770803 -0700
@@ -0,0 +1,9 @@
+package EditorJunk::Bar;
+
+
+use strict;
+
+
+1;
+
+
diff -urN perl-5.10.0.orig/t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm.swo perl-5.10.0/t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm.swo
--- perl-5.10.0.orig/t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm.swo 1969-12-31 16:00:00.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm.swo 2009-08-31 19:47:24.852771985 -0700
@@ -0,0 +1,9 @@
+package EditorJunk::Bar;
+
+
+use strict;
+
+
+1;
+
+
diff -urN perl-5.10.0.orig/t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm.swp perl-5.10.0/t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm.swp
--- perl-5.10.0.orig/t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm.swp 1969-12-31 16:00:00.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm.swp 2009-08-31 19:47:24.853771770 -0700
@@ -0,0 +1,9 @@
+package EditorJunk::Bar;
+
+
+use strict;
+
+
+1;
+
+
diff -urN perl-5.10.0.orig/t/Module_Pluggable/lib/EditorJunk/Plugin/Foo.pm perl-5.10.0/t/Module_Pluggable/lib/EditorJunk/Plugin/Foo.pm
--- perl-5.10.0.orig/t/Module_Pluggable/lib/EditorJunk/Plugin/Foo.pm 1969-12-31 16:00:00.000000000 -0800
+++ perl-5.10.0/t/Module_Pluggable/lib/EditorJunk/Plugin/Foo.pm 2009-08-31 19:47:24.854771835 -0700
@@ -0,0 +1,9 @@
+package EditorJunk::Foo;
+
+
+use strict;
+
+
+1;
+
+
perl-update-Scalar-List-Utils.patch:
MANIFEST | 3
ext/List/Util/Changes | 22 +++++
ext/List/Util/Makefile.PL | 113 +++++++++++++++++---------
ext/List/Util/Util.xs | 76 +++++++++++++++--
ext/List/Util/lib/List/Util.pm | 88 ++++----------------
ext/List/Util/lib/List/Util/PP.pm | 75 +++++++++++++++++
ext/List/Util/lib/List/Util/XS.pm | 45 ++++++++++
ext/List/Util/lib/Scalar/Util.pm | 154 +++++++++++-------------------------
ext/List/Util/lib/Scalar/Util/PP.pm | 109 +++++++++++++++++++++++++
ext/List/Util/t/00version.t | 7 +
ext/List/Util/t/blessed.t | 25 +++++
ext/List/Util/t/dualvar.t | 9 +-
ext/List/Util/t/expfail.t | 29 ++++++
ext/List/Util/t/lln.t | 13 ++-
ext/List/Util/t/max.t | 35 +++++++-
ext/List/Util/t/min.t | 35 +++++++-
ext/List/Util/t/openhan.t | 72 +++++++++++++++-
ext/List/Util/t/p_00version.t | 26 ++++++
ext/List/Util/t/p_tainted.t | 4
ext/List/Util/t/reduce.t | 12 ++
ext/List/Util/t/refaddr.t | 15 +++
ext/List/Util/t/reftype.t | 6 -
ext/List/Util/t/stack-corruption.t | 30 +++++++
ext/List/Util/t/sum.t | 32 +++++++
ext/List/Util/t/weak.t | 16 ++-
25 files changed, 799 insertions(+), 252 deletions(-)
--- NEW FILE perl-update-Scalar-List-Utils.patch ---
Scalar-List-Utils-1.21
Makefile.PL patched to build Util.so instead of ListUtil.so
diff -urN perl-5.10.0.orig/MANIFEST perl-5.10.0/MANIFEST
--- perl-5.10.0.orig/MANIFEST 2007-12-18 11:47:07.000000000 +0100
+++ perl-5.10.0/MANIFEST 2009-07-10 12:34:47.000000000 +0200
@@ -842,6 +842,7 @@
ext/List/Util/t/00version.t Scalar::Util
ext/List/Util/t/blessed.t Scalar::Util
ext/List/Util/t/dualvar.t Scalar::Util
+ext/List/Util/t/expfail.t Scalar::Util
ext/List/Util/t/first.t List::Util
ext/List/Util/t/isvstring.t Scalar::Util
ext/List/Util/t/lln.t Scalar::Util
@@ -850,6 +851,7 @@
ext/List/Util/t/minstr.t List::Util
ext/List/Util/t/min.t List::Util
ext/List/Util/t/openhan.t Scalar::Util
+ext/List/Util/t/p_00version.t Scalar::Util
ext/List/Util/t/p_blessed.t Scalar::Util
ext/List/Util/t/p_first.t List::Util
ext/List/Util/t/p_lln.t Scalar::Util
@@ -871,6 +873,7 @@
ext/List/Util/t/refaddr.t Scalar::Util
ext/List/Util/t/reftype.t Scalar::Util
ext/List/Util/t/shuffle.t List::Util
+ext/List/Util/t/stack-corruption.t List::Util
ext/List/Util/t/sum.t List::Util
ext/List/Util/t/tainted.t Scalar::Util
ext/List/Util/t/weak.t Scalar::Util
diff -urN perl-5.10.0.orig/ext/List/Util/Changes perl-5.10.0/ext/List/Util/Changes
--- perl-5.10.0.orig/ext/List/Util/Changes 2007-12-18 11:47:07.000000000 +0100
+++ perl-5.10.0/ext/List/Util/Changes 2009-07-08 17:22:59.000000000 +0200
@@ -1,3 +1,25 @@
+1.21 -- Mon May 18 10:32:14 CDT 2009
+
+ * Change build system for perl-only install not to need to modify blib
+ * When building inside perl, tests for weaken should be always run (Alexandr Ciornii)
+
+1.20 -- Wed May 13 16:42:53 CDT 2009
+
+*** NOTE***
+This distribution now requires perl 5.6 or greater
+
+Bug Fixes
+ * Fixed stack pop issue in POP_MULTICALL
+ * Fixed error reporting in import when XS not compiled
+ * Check first argument to reduce is a CODE reference to avoid segfault
+ * Handle overloaded and tied values
+ * Fix tainted test to run on Win32
+
+Enhancements
+ * Added List::Util::XS so authors can depend on XS version
+ * Removed need for dummy methods in UNIVERSAL for perl-only code
+
+
1.19 -- Sun Dec 10 09:58:03 CST 2006
Bug Fixes
diff -urN perl-5.10.0.orig/ext/List/Util/Makefile.PL perl-5.10.0/ext/List/Util/Makefile.PL
--- perl-5.10.0.orig/ext/List/Util/Makefile.PL 2007-12-18 11:47:07.000000000 +0100
+++ perl-5.10.0/ext/List/Util/Makefile.PL 2009-05-15 04:54:09.000000000 +0200
@@ -1,47 +1,86 @@
+# -*- perl -*-
+BEGIN { require 5.006; } # allow CPAN testers to get the point
+use strict;
+use warnings;
+use Config;
+use File::Spec;
use ExtUtils::MakeMaker;
+my $PERL_CORE = grep { $_ eq 'PERL_CORE=1' } @ARGV;
+
+my $do_xs = $PERL_CORE || can_cc();
+
+for (@ARGV) {
+ /^-pm/ and $do_xs = 0;
+ /^-xs/ and $do_xs = 1;
+}
WriteMakefile(
- VERSION_FROM => "lib/List/Util.pm",
- MAN3PODS => {}, # Pods will be built by installman.
- NAME => "List::Util",
- DEFINE => "-DPERL_EXT",
+ NAME => q[List::Util],
+ ABSTRACT => q[Common Scalar and List utility subroutines],
+ AUTHOR => q[Graham Barr <gbarr at cpan.org>],
+ DEFINE => q[-DPERL_EXT],
+ DISTNAME => q[Scalar-List-Utils],
+ VERSION_FROM => 'lib/List/Util.pm',
+
+ # We go through the ListUtil.xs trickery to foil platforms
+ # that have the feature combination of
+ # (1) static builds
+ # (2) allowing only one object by the same name in the static library
+ # (3) the object name matching being case-blind
+ # This means that we can't have the top-level util.o
+ # and the extension-level Util.o in the same build.
+ # One such platform is the POSIX-BC BS2000 EBCDIC mainframe platform.
+ XS => {'Util.xs' => 'Util.c'},
+ OBJECT => 'Util$(OBJ_EXT)',
+ ( $PERL_CORE
+ ? ()
+ : (
+ INSTALLDIRS => q[perl],
+ PREREQ_PM => {'Test::More' => 0,},
+ (eval { ExtUtils::MakeMaker->VERSION(6.31) } ? (LICENSE => 'perl') : ()),
+ ($do_xs ? () : (XS => {}, C => [], OBJECT => '')),
+ ( eval { ExtUtils::MakeMaker->VERSION(6.46) } ? (
+ META_MERGE => {
+ resources => { ##
+ repository => 'http://github.com/gbarr/Scalar-List-Utils',
+ },
+ }
+ )
+ : ()
+ ),
+ )
+ ),
);
-package MY;
-# We go through the ListUtil.c trickery to foil platforms
-# that have the feature combination of
-# (1) static builds
-# (2) allowing only one object by the same name in the static library
-# (3) the object name matching being case-blind
-# This means that we can't have the top-level util.o
-# and the extension-level Util.o in the same build.
-# One such platform is the POSIX-BC BS2000 EBCDIC mainframe platform.
-
-BEGIN {
- use Config;
- unless (defined $Config{usedl}) {
- eval <<'__EOMM__';
-sub xs_c {
- my($self) = shift;
- return '' unless $self->needs_linking();
-'
-ListUtil.c: Util.xs
- $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) Util.xs > ListUtil.xsc && $(MV) ListUtil.xsc ListUtil.c
-';
-}
+sub can_cc {
+
+ foreach my $cmd (split(/ /, $Config::Config{cc})) {
+ my $_cmd = $cmd;
+ return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd));
+
+ for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
+ my $abs = File::Spec->catfile($dir, $_[1]);
+ return $abs if (-x $abs or $abs = MM->maybe_command($abs));
+ }
+ }
-sub xs_o {
- my($self) = shift;
- return '' unless $self->needs_linking();
-'
-
-Util$(OBJ_EXT): ListUtil.c
- $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) ListUtil.c
- $(MV) ListUtil$(OBJ_EXT) Util$(OBJ_EXT)
-';
+ return;
}
-__EOMM__
- }
+package MY;
+
+sub init_PM {
+ my $self = shift;
+
+ $self->SUPER::init_PM(@_);
+
+ return if $do_xs;
+
+ my $pm = $self->{PM};
+ my $pm_file = File::Spec->catfile(qw(lib List Util XS.pm));
+
+ # When installing pure perl, install XS.pp as XS.pm
+ $self->{PM}{'XS.pp'} = delete $self->{PM}{$pm_file};
}
+
diff -urN perl-5.10.0.orig/ext/List/Util/Util.xs perl-5.10.0/ext/List/Util/Util.xs
--- perl-5.10.0.orig/ext/List/Util/Util.xs 2007-12-18 11:47:07.000000000 +0100
+++ perl-5.10.0/ext/List/Util/Util.xs 2009-05-13 23:59:43.000000000 +0200
@@ -147,18 +147,38 @@
int index;
NV retval;
SV *retsv;
+ int magic;
if(!items) {
XSRETURN_UNDEF;
}
retsv = ST(0);
- retval = slu_sv_value(retsv);
+ magic = SvAMAGIC(retsv);
+ if (!magic) {
+ retval = slu_sv_value(retsv);
+ }
for(index = 1 ; index < items ; index++) {
SV *stacksv = ST(index);
- NV val = slu_sv_value(stacksv);
- if(val < retval ? !ix : ix) {
- retsv = stacksv;
- retval = val;
- }
+ SV *tmpsv;
+ if ((magic || SvAMAGIC(stacksv)) && (tmpsv = amagic_call(retsv, stacksv, gt_amg, 0))) {
+ if (SvTRUE(tmpsv) ? !ix : ix) {
+ retsv = stacksv;
+ magic = SvAMAGIC(retsv);
+ if (!magic) {
+ retval = slu_sv_value(retsv);
+ }
+ }
+ }
+ else {
+ NV val = slu_sv_value(stacksv);
+ if (magic) {
+ retval = slu_sv_value(retsv);
+ magic = 0;
+ }
+ if(val < retval ? !ix : ix) {
+ retsv = stacksv;
+ retval = val;
+ }
+ }
}
ST(0) = retsv;
XSRETURN(1);
@@ -166,25 +186,49 @@
-NV
+void
sum(...)
PROTOTYPE: @
CODE:
{
SV *sv;
+ SV *retsv = NULL;
int index;
+ int magic;
+ NV retval = 0;
if(!items) {
XSRETURN_UNDEF;
}
sv = ST(0);
- RETVAL = slu_sv_value(sv);
+ if (SvAMAGIC(sv)) {
+ retsv = sv_newmortal();
+ sv_setsv(retsv, sv);
+ }
+ else {
+ retval = slu_sv_value(sv);
+ }
for(index = 1 ; index < items ; index++) {
sv = ST(index);
- RETVAL += slu_sv_value(sv);
+ if (retsv || SvAMAGIC(sv)) {
+ if (!retsv) {
+ retsv = sv_newmortal();
+ sv_setnv(retsv,retval);
+ }
+ if (!amagic_call(retsv, sv, add_amg, AMGf_assign)) {
+ sv_setnv(retsv, SvNV(retsv) + SvNV(sv));
+ }
+ }
+ else {
+ retval += slu_sv_value(sv);
+ }
+ }
+ if (!retsv) {
+ retsv = sv_newmortal();
+ sv_setnv(retsv,retval);
}
+ ST(0) = retsv;
+ XSRETURN(1);
}
-OUTPUT:
- RETVAL
void
@@ -252,6 +296,9 @@
XSRETURN_UNDEF;
}
cv = sv_2cv(block, &stash, &gv, 0);
+ if (cv == Nullcv) {
+ croak("Not a subroutine reference");
+ }
PUSH_MULTICALL(cv);
agv = gv_fetchpv("a", TRUE, SVt_PV);
bgv = gv_fetchpv("b", TRUE, SVt_PV);
@@ -485,6 +532,13 @@
SV *sv
PROTOTYPE: $
CODE:
+ SV *tempsv;
+ if (SvAMAGIC(sv) && (tempsv = AMG_CALLun(sv, numer))) {
+ sv = tempsv;
+ }
+ else if (SvMAGICAL(sv)) {
+ SvGETMAGIC(sv);
+ }
#if (PERL_VERSION < 8) || (PERL_VERSION == 8 && PERL_SUBVERSION <5)
if (SvPOK(sv) || SvPOKp(sv)) {
RETVAL = looks_like_number(sv);
diff -urN perl-5.10.0.orig/ext/List/Util/lib/List/Util/PP.pm perl-5.10.0/ext/List/Util/lib/List/Util/PP.pm
--- perl-5.10.0.orig/ext/List/Util/lib/List/Util/PP.pm 1970-01-01 01:00:00.000000000 +0100
+++ perl-5.10.0/ext/List/Util/lib/List/Util/PP.pm 2009-07-08 17:22:59.000000000 +0200
@@ -0,0 +1,75 @@
+# List::Util::PP.pm
+#
+# Copyright (c) 1997-2009 Graham Barr <gbarr at pobox.com>. All rights reserved.
+# This program is free software; you can redistribute it and/or
+# modify it under the same terms as Perl itself.
+
+package List::Util::PP;
+
+use strict;
+use warnings;
+use vars qw(@ISA @EXPORT $VERSION $a $b);
+require Exporter;
+
+ at ISA = qw(Exporter);
+ at EXPORT = qw(first min max minstr maxstr reduce sum shuffle);
+$VERSION = "1.21";
+$VERSION = eval $VERSION;
+
+sub reduce (&@) {
+ my $code = shift;
+ unless(ref($code)) {
+ require Carp;
+ Carp::croak("Not a subroutine reference");
+ }
+ no strict 'refs';
+
+ return shift unless @_ > 1;
+
+ use vars qw($a $b);
+
+ my $caller = caller;
+ local(*{$caller."::a"}) = \my $a;
+ local(*{$caller."::b"}) = \my $b;
+
+ $a = shift;
+ foreach (@_) {
+ $b = $_;
+ $a = &{$code}();
+ }
+
+ $a;
+}
+
+sub first (&@) {
+ my $code = shift;
+
+ foreach (@_) {
+ return $_ if &{$code}();
+ }
+
+ undef;
+}
+
+
+sub sum (@) { reduce { $a + $b } @_ }
+
+sub min (@) { reduce { $a < $b ? $a : $b } @_ }
+
+sub max (@) { reduce { $a > $b ? $a : $b } @_ }
+
+sub minstr (@) { reduce { $a lt $b ? $a : $b } @_ }
+
+sub maxstr (@) { reduce { $a gt $b ? $a : $b } @_ }
+
+sub shuffle (@) {
+ my @a=\(@_);
+ my $n;
+ my $i=@_;
+ map {
+ $n = rand($i--);
+ (${$a[$n]}, $a[$n] = $a[$i])[0];
+ } @_;
+}
+
+1;
diff -urN perl-5.10.0.orig/ext/List/Util/lib/List/Util/XS.pm perl-5.10.0/ext/List/Util/lib/List/Util/XS.pm
--- perl-5.10.0.orig/ext/List/Util/lib/List/Util/XS.pm 1970-01-01 01:00:00.000000000 +0100
+++ perl-5.10.0/ext/List/Util/lib/List/Util/XS.pm 2009-07-08 17:22:59.000000000 +0200
@@ -0,0 +1,45 @@
+package List::Util::XS;
+use strict;
+use vars qw($VERSION);
+use List::Util;
+
+$VERSION = "1.21"; # FIXUP
+$VERSION = eval $VERSION; # FIXUP
+
+sub _VERSION { # FIXUP
+ require Carp;
+ Carp::croak("You need to install Scalar-List-Utils with a C compiler to ensure the XS is compiled")
+ if defined $_[1];
+ $VERSION;
+}
+
+1;
+__END__
+
+=head1 NAME
+
+List::Util::XS - Indicate if List::Util was compiled with a C compiler
+
+=head1 SYNOPSIS
+
+ use List::Util::XS 1.20;
+
+=head1 DESCRIPTION
+
+C<List::Util::XS> can be used as a dependency to ensure List::Util was
+installed using a C compiler and that the XS version is installed.
+
+During installation C<$List::Util::XS::VERSION> will be set to
+C<undef> if the XS was not compiled.
+
+=head1 SEE ALSO
+
+L<Scalar::Util>, L<List::Util>, L<List::MoreUtils>
+
+=head1 COPYRIGHT
+
+Copyright (c) 2008 Graham Barr <gbarr at pobox.com>. All rights reserved.
+This program is free software; you can redistribute it and/or
+modify it under the same terms as Perl itself.
+
+=cut
diff -urN perl-5.10.0.orig/ext/List/Util/lib/List/Util.pm perl-5.10.0/ext/List/Util/lib/List/Util.pm
--- perl-5.10.0.orig/ext/List/Util/lib/List/Util.pm 2007-12-18 11:47:07.000000000 +0100
+++ perl-5.10.0/ext/List/Util/lib/List/Util.pm 2009-07-08 17:22:59.000000000 +0200
@@ -1,8 +1,10 @@
# List::Util.pm
#
-# Copyright (c) 1997-2006 Graham Barr <gbarr at pobox.com>. All rights reserved.
+# Copyright (c) 1997-2009 Graham Barr <gbarr at pobox.com>. All rights reserved.
# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
+#
+# This module is normally only loaded if the XS module is not available
package List::Util;
@@ -12,7 +14,7 @@
@ISA = qw(Exporter);
@EXPORT_OK = qw(first min max minstr maxstr reduce sum shuffle);
-$VERSION = "1.19";
+$VERSION = "1.21";
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
@@ -32,73 +34,11 @@
} unless $TESTING_PERL_ONLY;
-# This code is only compiled if the XS did not load
-# of for perl < 5.6.0
-
-if (!defined &reduce) {
-eval <<'ESQ'
-
-sub reduce (&@) {
- my $code = shift;
- no strict 'refs';
-
- return shift unless @_ > 1;
-
- use vars qw($a $b);
-
- my $caller = caller;
- local(*{$caller."::a"}) = \my $a;
- local(*{$caller."::b"}) = \my $b;
-
- $a = shift;
- foreach (@_) {
- $b = $_;
- $a = &{$code}();
- }
-
- $a;
-}
-
-sub first (&@) {
- my $code = shift;
-
- foreach (@_) {
- return $_ if &{$code}();
- }
-
- undef;
-}
-
-ESQ
-}
-
-# This code is only compiled if the XS did not load
-eval <<'ESQ' if !defined ∑
-
-use vars qw($a $b);
-
-sub sum (@) { reduce { $a + $b } @_ }
-
-sub min (@) { reduce { $a < $b ? $a : $b } @_ }
-
-sub max (@) { reduce { $a > $b ? $a : $b } @_ }
-
-sub minstr (@) { reduce { $a lt $b ? $a : $b } @_ }
-
-sub maxstr (@) { reduce { $a gt $b ? $a : $b } @_ }
-
-sub shuffle (@) {
- my @a=\(@_);
- my $n;
- my $i=@_;
- map {
- $n = rand($i--);
- (${$a[$n]}, $a[$n] = $a[$i])[0];
- } @_;
+if (!defined &sum) {
+ require List::Util::PP;
+ List::Util::PP->import;
}
-ESQ
-
1;
__END__
@@ -212,6 +152,12 @@
$foo = reduce { $a + $b } 1 .. 10 # sum
$foo = reduce { $a . $b } @bar # concat
+If your algorithm requires that C<reduce> produce an identity value, then
+make sure that you always pass that identity value as the first argument to prevent
+C<undef> being returned
+
+ $foo = reduce { $a + $b } 0, @values; # sum with 0 identity value
+
=item shuffle LIST
Returns the elements of LIST in a random order
@@ -231,6 +177,12 @@
$foo = reduce { $a + $b } 1..10
+If your algorithm requires that C<sum> produce an identity of 0, then
+make sure that you always pass C<0> as the first argument to prevent
+C<undef> being returned
+
+ $foo = sum 0, @values;
+
=back
=head1 KNOWN BUGS
@@ -274,7 +226,7 @@
=head1 COPYRIGHT
-Copyright (c) 1997-2006 Graham Barr <gbarr at pobox.com>. All rights reserved.
+Copyright (c) 1997-2007 Graham Barr <gbarr at pobox.com>. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
diff -urN perl-5.10.0.orig/ext/List/Util/lib/Scalar/Util/PP.pm perl-5.10.0/ext/List/Util/lib/Scalar/Util/PP.pm
--- perl-5.10.0.orig/ext/List/Util/lib/Scalar/Util/PP.pm 1970-01-01 01:00:00.000000000 +0100
+++ perl-5.10.0/ext/List/Util/lib/Scalar/Util/PP.pm 2009-07-08 17:22:59.000000000 +0200
@@ -0,0 +1,109 @@
+# Scalar::Util::PP.pm
+#
+# Copyright (c) 1997-2009 Graham Barr <gbarr at pobox.com>. All rights reserved.
+# This program is free software; you can redistribute it and/or
+# modify it under the same terms as Perl itself.
+#
+# This module is normally only loaded if the XS module is not available
+
+package Scalar::Util::PP;
+
+use strict;
+use warnings;
+use vars qw(@ISA @EXPORT $VERSION $recurse);
+require Exporter;
+use B qw(svref_2object);
+
+ at ISA = qw(Exporter);
+ at EXPORT = qw(blessed reftype tainted readonly refaddr looks_like_number);
+$VERSION = "1.21";
+$VERSION = eval $VERSION;
+
+sub blessed ($) {
+ return undef unless length(ref($_[0]));
+ my $b = svref_2object($_[0]);
+ return undef unless $b->isa('B::PVMG');
+ my $s = $b->SvSTASH;
+ return $s->isa('B::HV') ? $s->NAME : undef;
+}
+
+sub refaddr($) {
+ return undef unless length(ref($_[0]));
+
+ my $addr;
+ if(defined(my $pkg = blessed($_[0]))) {
+ $addr .= bless $_[0], 'Scalar::Util::Fake';
+ bless $_[0], $pkg;
+ }
+ else {
+ $addr .= $_[0]
+ }
+
+ $addr =~ /0x(\w+)/;
+ local $^W;
+ hex($1);
+}
+
+{
+ my %tmap = qw(
+ B::HV HASH
+ B::AV ARRAY
+ B::CV CODE
+ B::IO IO
+ B::NULL SCALAR
+ B::NV SCALAR
+ B::PV SCALAR
+ B::GV GLOB
+ B::RV REF
+ B::REGEXP REGEXP
+ );
+
+ sub reftype ($) {
+ my $r = shift;
+
+ return undef unless length(ref($r));
+
+ my $t = ref(svref_2object($r));
+
+ return
+ exists $tmap{$t} ? $tmap{$t}
+ : length(ref($$r)) ? 'REF'
+ : 'SCALAR';
+ }
+}
+
+sub tainted {
+ local($@, $SIG{__DIE__}, $SIG{__WARN__});
+ local $^W = 0;
+ no warnings;
+ eval { kill 0 * $_[0] };
+ $@ =~ /^Insecure/;
+}
+
+sub readonly {
+ return 0 if tied($_[0]) || (ref(\($_[0])) ne "SCALAR");
+
+ local($@, $SIG{__DIE__}, $SIG{__WARN__});
+ my $tmp = $_[0];
+
+ !eval { $_[0] = $tmp; 1 };
+}
+
+sub looks_like_number {
+ local $_ = shift;
+
+ # checks from perlfaq4
+ return 0 if !defined($_);
+ if (ref($_)) {
+ require overload;
+ return overload::Overloaded($_) ? defined(0 + $_) : 0;
+ }
+ return 1 if (/^[+-]?\d+$/); # is a +/- integer
+ return 1 if (/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/); # a C float
+ return 1 if ($] >= 5.008 and /^(Inf(inity)?|NaN)$/i) or ($] >= 5.006001 and /^Inf$/i);
+
+ 0;
+}
+
+
+1;
diff -urN perl-5.10.0.orig/ext/List/Util/lib/Scalar/Util.pm perl-5.10.0/ext/List/Util/lib/Scalar/Util.pm
--- perl-5.10.0.orig/ext/List/Util/lib/Scalar/Util.pm 2007-12-18 11:47:07.000000000 +0100
+++ perl-5.10.0/ext/List/Util/lib/Scalar/Util.pm 2009-07-08 17:22:59.000000000 +0200
@@ -1,34 +1,46 @@
# Scalar::Util.pm
#
-# Copyright (c) 1997-2006 Graham Barr <gbarr at pobox.com>. All rights reserved.
+# Copyright (c) 1997-2007 Graham Barr <gbarr at pobox.com>. All rights reserved.
# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
package Scalar::Util;
use strict;
-use vars qw(@ISA @EXPORT_OK $VERSION);
+use vars qw(@ISA @EXPORT_OK $VERSION @EXPORT_FAIL);
require Exporter;
require List::Util; # List::Util loads the XS
@ISA = qw(Exporter);
@EXPORT_OK = qw(blessed dualvar reftype weaken isweak tainted readonly openhandle refaddr isvstring looks_like_number set_prototype);
-$VERSION = "1.19";
+$VERSION = "1.21";
$VERSION = eval $VERSION;
+unless (defined &dualvar) {
+ # Load Pure Perl version if XS not loaded
+ require Scalar::Util::PP;
+ Scalar::Util::PP->import;
+ push @EXPORT_FAIL, qw(weaken isweak dualvar isvstring set_prototype);
+}
+
sub export_fail {
+ if (grep { /dualvar/ } @EXPORT_FAIL) { # no XS loaded
+ my $pat = join("|", @EXPORT_FAIL);
+ if (my ($err) = grep { /^($pat)$/ } @_ ) {
+ require Carp;
+ Carp::croak("$err is only available with the XS version of Scalar::Util");
+ }
+ }
+
if (grep { /^(weaken|isweak)$/ } @_ ) {
require Carp;
Carp::croak("Weak references are not implemented in the version of perl");
}
+
if (grep { /^(isvstring)$/ } @_ ) {
require Carp;
Carp::croak("Vstrings are not implemented in the version of perl");
}
- if (grep { /^(dualvar|set_prototype)$/ } @_ ) {
- require Carp;
- Carp::croak("$1 is only avaliable with the XS version");
- }
@_;
}
@@ -51,96 +63,6 @@
? $fh : undef;
}
-eval <<'ESQ' unless defined &dualvar;
-
-use vars qw(@EXPORT_FAIL);
-push @EXPORT_FAIL, qw(weaken isweak dualvar isvstring set_prototype);
-
-# The code beyond here is only used if the XS is not installed
-
-# Hope nobody defines a sub by this name
-sub UNIVERSAL::a_sub_not_likely_to_be_here { ref($_[0]) }
-
-sub blessed ($) {
- local($@, $SIG{__DIE__}, $SIG{__WARN__});
- length(ref($_[0]))
- ? eval { $_[0]->a_sub_not_likely_to_be_here }
- : undef
-}
-
-sub refaddr($) {
- my $pkg = ref($_[0]) or return undef;
- if (blessed($_[0])) {
- bless $_[0], 'Scalar::Util::Fake';
- }
- else {
- $pkg = undef;
- }
- "$_[0]" =~ /0x(\w+)/;
- my $i = do { local $^W; hex $1 };
- bless $_[0], $pkg if defined $pkg;
- $i;
-}
-
-sub reftype ($) {
- local($@, $SIG{__DIE__}, $SIG{__WARN__});
- my $r = shift;
- my $t;
-
- length($t = ref($r)) or return undef;
-
- # This eval will fail if the reference is not blessed
- eval { $r->a_sub_not_likely_to_be_here; 1 }
- ? do {
- $t = eval {
- # we have a GLOB or an IO. Stringify a GLOB gives it's name
- my $q = *$r;
- $q =~ /^\*/ ? "GLOB" : "IO";
- }
- or do {
- # OK, if we don't have a GLOB what parts of
- # a glob will it populate.
- # NOTE: A glob always has a SCALAR
- local *glob = $r;
- defined *glob{ARRAY} && "ARRAY"
- or defined *glob{HASH} && "HASH"
- or defined *glob{CODE} && "CODE"
- or length(ref(${$r})) ? "REF" : "SCALAR";
- }
- }
- : $t
-}
-
-sub tainted {
- local($@, $SIG{__DIE__}, $SIG{__WARN__});
- local $^W = 0;
- eval { kill 0 * $_[0] };
- $@ =~ /^Insecure/;
-}
-
-sub readonly {
- return 0 if tied($_[0]) || (ref(\($_[0])) ne "SCALAR");
-
- local($@, $SIG{__DIE__}, $SIG{__WARN__});
- my $tmp = $_[0];
-
- !eval { $_[0] = $tmp; 1 };
-}
-
-sub looks_like_number {
- local $_ = shift;
-
- # checks from perlfaq4
- return 0 if !defined($_) or ref($_);
- return 1 if (/^[+-]?\d+$/); # is a +/- integer
- return 1 if (/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/); # a C float
- return 1 if ($] >= 5.008 and /^(Inf(inity)?|NaN)$/i) or ($] >= 5.006001 and /^Inf$/i);
-
- 0;
-}
-
-ESQ
-
1;
__END__
@@ -153,6 +75,7 @@
use Scalar::Util qw(blessed dualvar isweak readonly refaddr reftype tainted
weaken isvstring looks_like_number set_prototype);
+ # and other useful utils appearing below
=head1 DESCRIPTION
@@ -209,7 +132,7 @@
B<NOTE>: Copying a weak reference creates a normal, strong, reference.
$copy = $ref;
- $weak = isweak($ref); # false
+ $weak = isweak($copy); # false
=item looks_like_number EXPR
@@ -310,6 +233,32 @@
=back
+=head1 DIAGNOSTICS
+
+Module use may give one of the following errors during import.
+
+=over
+
+=item Weak references are not implemented in the version of perl
+
+The version of perl that you are using does not implement weak references, to use
+C<isweak> or C<weaken> you will need to use a newer release of perl.
+
+=item Vstrings are not implemented in the version of perl
+
+The version of perl that you are using does not implement Vstrings, to use
+C<isvstring> you will need to use a newer release of perl.
+
+=item C<NAME> is only available with the XS version of Scalar::Util
+
+C<Scalar::Util> contains both perl and C implementations of many of its functions
+so that those without access to a C compiler may still use it. However some of the functions
+are only available when a C compiler was available to compile the XS version of the extension.
+
+At present that list is: weaken, isweak, dualvar, isvstring, set_prototype
+
+=back
+
=head1 KNOWN BUGS
There is a bug in perl5.6.0 with UV's that are >= 1<<31. This will
@@ -321,7 +270,7 @@
=head1 COPYRIGHT
-Copyright (c) 1997-2006 Graham Barr <gbarr at pobox.com>. All rights reserved.
+Copyright (c) 1997-2007 Graham Barr <gbarr at pobox.com>. All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
@@ -331,11 +280,4 @@
This program is free software; you can redistribute it and/or modify it
under the same terms as perl itself.
-=head1 BLATANT PLUG
-
-The weaken and isweak subroutines in this module and the patch to the core Perl
-were written in connection with the APress book `Tuomas J. Lukka's Definitive
-Guide to Object-Oriented Programming in Perl', to avoid explaining why certain
-things would have to be done in cumbersome ways.
-
=cut
diff -urN perl-5.10.0.orig/ext/List/Util/t/00version.t perl-5.10.0/ext/List/Util/t/00version.t
--- perl-5.10.0.orig/ext/List/Util/t/00version.t 2007-12-18 11:47:07.000000000 +0100
+++ perl-5.10.0/ext/List/Util/t/00version.t 2009-07-08 17:22:59.000000000 +0200
@@ -15,8 +15,11 @@
use Scalar::Util ();
use List::Util ();
-use Test::More tests => 1;
+use List::Util::XS ();
+use Test::More tests => 2;
is( $Scalar::Util::VERSION, $List::Util::VERSION, "VERSION mismatch");
-
+my $has_xs = eval { Scalar::Util->import('dualvar'); 1 };
+my $xs_version = $has_xs ? $List::Util::VERSION : undef;
+is( $List::Util::XS::VERSION, $xs_version, "XS VERSION");
diff -urN perl-5.10.0.orig/ext/List/Util/t/blessed.t perl-5.10.0/ext/List/Util/t/blessed.t
--- perl-5.10.0.orig/ext/List/Util/t/blessed.t 2007-12-18 11:47:07.000000000 +0100
+++ perl-5.10.0/ext/List/Util/t/blessed.t 2009-07-08 17:22:59.000000000 +0200
@@ -13,7 +13,7 @@
}
}
-use Test::More tests => 8;
+use Test::More tests => 11;
use Scalar::Util qw(blessed);
use vars qw($t $x);
@@ -29,3 +29,26 @@
$x = bless {}, "DEF";
is(blessed($x), "DEF", 'blessed HASH-ref');
+
+$x = bless {}, "0";
+cmp_ok(blessed($x), "eq", "0", 'blessed HASH-ref');
+
+{
+ my $depth;
+ {
+ no warnings 'redefine';
+ *UNIVERSAL::can = sub { die "Burp!" if ++$depth > 2; blessed(shift) };
+ }
+ $x = bless {}, "DEF";
+ is(blessed($x), "DEF", 'recursion of UNIVERSAL::can');
+}
+
+{
+ package Broken;
+ sub isa { die };
+ sub can { die };
+
+ my $obj = bless [], __PACKAGE__;
+ ::is( ::blessed($obj), __PACKAGE__, "blessed on broken isa() and can()" );
+}
+
diff -urN perl-5.10.0.orig/ext/List/Util/t/dualvar.t perl-5.10.0/ext/List/Util/t/dualvar.t
--- perl-5.10.0.orig/ext/List/Util/t/dualvar.t 2007-12-18 11:47:07.000000000 +0100
+++ perl-5.10.0/ext/List/Util/t/dualvar.t 2009-07-08 17:22:59.000000000 +0200
@@ -42,9 +42,12 @@
ok( $var == $numstr, 'NV');
-$var = dualvar(1<<31, "");
-ok( $var == (1<<31), 'UV 1');
-ok( $var > 0, 'UV 2');
+SKIP: {
+ skip("dualvar with UV value known to fail with $]",2) if $] < 5.006_001;
+ $var = dualvar(1<<31, "");
+ ok( $var == (1<<31), 'UV 1');
+ ok( $var > 0, 'UV 2');
+}
tie my $tied, 'Tied';
$var = dualvar($tied, "ok");
diff -urN perl-5.10.0.orig/ext/List/Util/t/expfail.t perl-5.10.0/ext/List/Util/t/expfail.t
--- perl-5.10.0.orig/ext/List/Util/t/expfail.t 1970-01-01 01:00:00.000000000 +0100
+++ perl-5.10.0/ext/List/Util/t/expfail.t 2009-07-08 17:22:59.000000000 +0200
@@ -0,0 +1,29 @@
+#!./perl
+
+BEGIN {
+ unless (-d 'blib') {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+ require Config; import Config;
+ keys %Config; # Silence warning
+ if ($Config{extensions} !~ /\bList\/Util\b/) {
+ print "1..0 # Skip: List::Util was not built\n";
+ exit 0;
+ }
+ }
+}
+
+use Test::More tests => 3;
+use strict;
+
+$List::Util::TESTING_PERL_ONLY = $List::Util::TESTING_PERL_ONLY = 1;
+require Scalar::Util;
+
+for my $func (qw(dualvar set_prototype weaken)) {
+ eval { Scalar::Util->import($func); };
+ like(
+ $@,
+ qr/$func is only available with the XS/,
+ "no pure perl $func: error raised",
+ );
+}
diff -urN perl-5.10.0.orig/ext/List/Util/t/lln.t perl-5.10.0/ext/List/Util/t/lln.t
--- perl-5.10.0.orig/ext/List/Util/t/lln.t 2007-12-18 11:47:07.000000000 +0100
+++ perl-5.10.0/ext/List/Util/t/lln.t 2009-07-08 17:22:59.000000000 +0200
@@ -14,7 +14,7 @@
}
use strict;
-use Test::More tests => 16;
+use Test::More tests => 18;
use Scalar::Util qw(looks_like_number);
foreach my $num (qw(1 -1 +1 1.0 +1.0 -1.0 -1.0e-12)) {
@@ -31,7 +31,16 @@
use Math::BigInt;
my $bi = Math::BigInt->new('1234567890');
-is(!!looks_like_number($bi), '', 'Math::BigInt');
+is(!!looks_like_number($bi), 1, 'Math::BigInt');
is(!!looks_like_number("$bi"), 1, 'Stringified Math::BigInt');
+{ package Foo;
+sub TIEHASH { bless {} }
+sub FETCH { $_[1] }
+}
+my %foo;
+tie %foo, 'Foo';
+is(!!looks_like_number($foo{'abc'}), '', 'Tied');
+is(!!looks_like_number($foo{'123'}), 1, 'Tied');
+
# We should copy some of perl core tests like t/base/num.t here
diff -urN perl-5.10.0.orig/ext/List/Util/t/max.t perl-5.10.0/ext/List/Util/t/max.t
--- perl-5.10.0.orig/ext/List/Util/t/max.t 2007-12-18 11:47:07.000000000 +0100
+++ perl-5.10.0/ext/List/Util/t/max.t 2009-07-08 17:22:59.000000000 +0200
@@ -14,7 +14,7 @@
}
use strict;
-use Test::More tests => 5;
+use Test::More tests => 8;
use List::Util qw(max);
my $v;
@@ -34,3 +34,36 @@
my @b = sort { $a <=> $b } @a;
$v = max(@a);
is($v, $b[-1], '20-arg random order');
+
+my $one = Foo->new(1);
+my $two = Foo->new(2);
+my $thr = Foo->new(3);
+
+$v = max($one,$two,$thr);
+is($v, 3, 'overload');
+
+$v = max($thr,$two,$one);
+is($v, 3, 'overload');
+
+{ package Foo;
+
+use overload
+ '""' => sub { ${$_[0]} },
+ '+0' => sub { ${$_[0]} },
+ fallback => 1;
+ sub new {
+ my $class = shift;
+ my $value = shift;
+ bless \$value, $class;
+ }
+}
+
+SKIP: {
+ eval { require bignum; } or skip("Need bignum for testing overloading",1);
+
+ my $v1 = 2**65;
+ my $v2 = $v1 - 1;
+ my $v3 = $v2 - 1;
+ $v = max($v1,$v2,$v1,$v3,$v1);
+ is($v, $v1, 'bigint');
+}
diff -urN perl-5.10.0.orig/ext/List/Util/t/min.t perl-5.10.0/ext/List/Util/t/min.t
--- perl-5.10.0.orig/ext/List/Util/t/min.t 2007-12-18 11:47:07.000000000 +0100
+++ perl-5.10.0/ext/List/Util/t/min.t 2009-07-08 17:22:59.000000000 +0200
@@ -14,7 +14,7 @@
}
use strict;
-use Test::More tests => 5;
+use Test::More tests => 8;
use List::Util qw(min);
my $v;
@@ -34,3 +34,36 @@
my @b = sort { $a <=> $b } @a;
$v = min(@a);
is($v, $b[0], '20-arg random order');
+
+my $one = Foo->new(1);
+my $two = Foo->new(2);
+my $thr = Foo->new(3);
+
+$v = min($one,$two,$thr);
+is($v, 1, 'overload');
+
+$v = min($thr,$two,$one);
+is($v, 1, 'overload');
+
+{ package Foo;
+
+use overload
+ '""' => sub { ${$_[0]} },
+ '+0' => sub { ${$_[0]} },
+ fallback => 1;
+ sub new {
+ my $class = shift;
+ my $value = shift;
+ bless \$value, $class;
+ }
+}
+
+SKIP: {
+ eval { require bignum; } or skip("Need bignum for testing overloading",1);
+
+ my $v1 = 2**65;
+ my $v2 = $v1 - 1;
+ my $v3 = $v2 - 1;
+ $v = min($v1,$v2,$v1,$v3,$v1);
+ is($v, $v3, 'bigint');
+}
diff -urN perl-5.10.0.orig/ext/List/Util/t/openhan.t perl-5.10.0/ext/List/Util/t/openhan.t
--- perl-5.10.0.orig/ext/List/Util/t/openhan.t 2007-12-18 11:47:07.000000000 +0100
+++ perl-5.10.0/ext/List/Util/t/openhan.t 2009-07-08 17:22:59.000000000 +0200
@@ -14,16 +14,76 @@
}
use strict;
-use vars qw(*CLOSED);
-use Test::More tests => 4;
+
+use Test::More tests => 14;
use Scalar::Util qw(openhandle);
ok(defined &openhandle, 'defined');
-my $fh = \*STDERR;
-is(openhandle($fh), $fh, 'STDERR');
+{
+ my $fh = \*STDERR;
+ is(openhandle($fh), $fh, 'STDERR');
+
+ is(fileno(openhandle(*STDERR)), fileno(STDERR), 'fileno(STDERR)');
+}
+
+{
+ use vars qw(*CLOSED);
+ is(openhandle(*CLOSED), undef, 'closed');
+}
+
+SKIP: {
+ skip "3-arg open only on 5.6 or later", 1 if $]<5.006;
+
+ open my $fh, "<", $0;
+ skip "could not open $0 for reading: $!", 1 unless $fh;
+ is(openhandle($fh), $fh, "works with indirect filehandles");
+}
-is(fileno(openhandle(*STDERR)), fileno(STDERR), 'fileno(STDERR)');
+SKIP: {
+ skip "in-memory files only on 5.8 or later", 1 if $]<5.008;
+
+ open my $fh, "<", \"in-memory file";
+ skip "could not open in-memory file: $!", 1 unless $fh;
+ is(openhandle($fh), $fh, "works with in-memory files");
+}
-is(openhandle(*CLOSED), undef, 'closed');
+ok(openhandle(\*DATA), "works for \*DATA");
+ok(openhandle(*DATA), "works for *DATA");
+ok(openhandle(*DATA{IO}), "works for *DATA{IO}");
+
+{
+ require IO::Handle;
+ my $fh = IO::Handle->new_from_fd(fileno(*STDERR), 'w');
+ skip "new_from_fd(fileno(*STDERR)) failed", 1 unless $fh;
+ ok(openhandle($fh), "works for IO::Handle objects");
+
+ ok(!openhandle(IO::Handle->new), "unopened IO::Handle");
+}
+
+{
+ require IO::File;
+ my $fh = IO::File->new;
+ $fh->open("< $0")
+ or skip "could not open $0: $!", 1;
+ ok(openhandle($fh), "works for IO::File objects");
+
+ ok(!openhandle(IO::File->new), "unopened IO::File" );
+}
+
+SKIP: {
+ skip( "Tied handles only on 5.8 or later", 1) if $]<5.008;
+
+ use vars qw(*H);
+
+ package My::Tie;
+ require Tie::Handle;
+ @My::Tie::ISA = qw(Tie::Handle);
+ sub TIEHANDLE { bless {} }
+
+ package main;
+ tie *H, 'My::Tie';
+ ok(openhandle(*H), "tied handles are always ok");
+}
+__DATA__
diff -urN perl-5.10.0.orig/ext/List/Util/t/p_00version.t perl-5.10.0/ext/List/Util/t/p_00version.t
--- perl-5.10.0.orig/ext/List/Util/t/p_00version.t 1970-01-01 01:00:00.000000000 +0100
+++ perl-5.10.0/ext/List/Util/t/p_00version.t 2009-07-08 17:22:59.000000000 +0200
@@ -0,0 +1,26 @@
+#!./perl
+
+BEGIN {
+ unless (-d 'blib') {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+ require Config; import Config;
+ keys %Config; # Silence warning
+ if ($Config{extensions} !~ /\bList\/Util\b/) {
+ print "1..0 # Skip: List::Util was not built\n";
+ exit 0;
+ }
+ }
+}
+
+use Test::More tests => 2;
+
+# force perl-only version to be tested
+$List::Util::TESTING_PERL_ONLY = $List::Util::TESTING_PERL_ONLY = 1;
+
+require Scalar::Util;
+require List::Util;
+
+is( $Scalar::Util::PP::VERSION, $List::Util::VERSION, "VERSION mismatch");
+is( $List::Util::PP::VERSION, $List::Util::VERSION, "VERSION mismatch");
+
diff -urN perl-5.10.0.orig/ext/List/Util/t/p_tainted.t perl-5.10.0/ext/List/Util/t/p_tainted.t
--- perl-5.10.0.orig/ext/List/Util/t/p_tainted.t 2007-12-18 11:47:07.000000000 +0100
+++ perl-5.10.0/ext/List/Util/t/p_tainted.t 2009-07-08 17:24:47.000000000 +0200
@@ -6,5 +6,7 @@
$List::Util::TESTING_PERL_ONLY = $List::Util::TESTING_PERL_ONLY = 1;
(my $f = __FILE__) =~ s/p_//;
-my $filename = File::Spec->catfile(".", $f);
+my $filename = $^O eq 'MSWin32'
+ ? File::Spec->rel2abs(File::Spec->catfile(".", $f))
+ : File::Spec->catfile(".", $f);
do $filename; die $@ if $@;
diff -urN perl-5.10.0.orig/ext/List/Util/t/reduce.t perl-5.10.0/ext/List/Util/t/reduce.t
--- perl-5.10.0.orig/ext/List/Util/t/reduce.t 2007-12-18 11:47:07.000000000 +0100
+++ perl-5.10.0/ext/List/Util/t/reduce.t 2009-07-08 17:22:59.000000000 +0200
@@ -16,7 +16,7 @@
use List::Util qw(reduce min);
use Test::More;
-plan tests => ($::PERL_ONLY ? 21 : 23);
+plan tests => ($::PERL_ONLY ? 23 : 25);
my $v = reduce {};
@@ -122,6 +122,16 @@
is(&Internals::SvREFCNT(\&mult), $refcnt, "Refcount unchanged");
}
+{
+ my $ok = 'failed';
+ local $SIG{__DIE__} = sub { $ok = $_[0] =~ /Not a (subroutine|CODE) reference/ ? '' : $_[0] };
+ eval { &reduce('foo',1,2) };
+ is($ok, '', 'Not a subroutine reference');
+ $ok = 'failed';
+ eval { &reduce({},1,2) };
+ is($ok, '', 'Not a subroutine reference');
+}
+
# The remainder of the tests are only relevant for the XS
# implementation. The Perl-only implementation behaves differently
# (and more flexibly) in a way that we can't emulate from XS.
diff -urN perl-5.10.0.orig/ext/List/Util/t/refaddr.t perl-5.10.0/ext/List/Util/t/refaddr.t
--- perl-5.10.0.orig/ext/List/Util/t/refaddr.t 2007-12-18 11:47:07.000000000 +0100
+++ perl-5.10.0/ext/List/Util/t/refaddr.t 2009-07-08 17:22:59.000000000 +0200
@@ -14,7 +14,7 @@
}
-use Test::More tests => 29;
+use Test::More tests => 32;
use Scalar::Util qw(refaddr);
use vars qw($t $y $x *F $v $r);
@@ -58,11 +58,22 @@
ok(refaddr($x{$y}));
ok(refaddr($x{$b}));
}
+{
+ my $z = bless {}, '0';
+ ok(refaddr($z));
+ @{"0::ISA"} = qw(FooBar);
+ my $a = {};
+ my $r = refaddr($a);
+ $z = bless $a, '0';
+ ok(refaddr($z) > 10);
+ is(refaddr($z),$r,"foo");
+}
package FooBar;
use overload '0+' => sub { 10 },
- '+' => sub { 10 + $_[1] };
+ '+' => sub { 10 + $_[1] },
+ '"' => sub { "10" };
package MyTie;
diff -urN perl-5.10.0.orig/ext/List/Util/t/reftype.t perl-5.10.0/ext/List/Util/t/reftype.t
--- perl-5.10.0.orig/ext/List/Util/t/reftype.t 2007-12-18 11:47:07.000000000 +0100
+++ perl-5.10.0/ext/List/Util/t/reftype.t 2009-07-08 17:22:59.000000000 +0200
@@ -13,7 +13,7 @@
}
}
-use Test::More tests => 23;
+use Test::More tests => 29;
use Scalar::Util qw(reftype);
use vars qw($t $y $x *F);
@@ -21,6 +21,7 @@
# Ensure we do not trigger and tied methods
tie *F, 'MyTie';
+my $RE = $] < 5.011 ? 'SCALAR' : 'REGEXP';
@test = (
[ undef, 1, 'number' ],
@@ -32,7 +33,8 @@
[ GLOB => \*F, 'tied GLOB ref' ],
[ GLOB => gensym, 'GLOB ref' ],
[ CODE => sub {}, 'CODE ref' ],
-# [ IO => *STDIN{IO} ] the internal sv_reftype returns UNKNOWN
+ [ IO => *STDIN{IO},'IO ref' ],
+ [ $RE => qr/x/, 'REGEEXP' ],
);
foreach $test (@test) {
diff -urN perl-5.10.0.orig/ext/List/Util/t/stack-corruption.t perl-5.10.0/ext/List/Util/t/stack-corruption.t
--- perl-5.10.0.orig/ext/List/Util/t/stack-corruption.t 1970-01-01 01:00:00.000000000 +0100
+++ perl-5.10.0/ext/List/Util/t/stack-corruption.t 2009-07-08 17:22:59.000000000 +0200
@@ -0,0 +1,30 @@
+#!./perl
+
+BEGIN {
+ unless (-d 'blib') {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+ require Config; import Config;
+ keys %Config; # Silence warning
+ if ($Config{extensions} !~ /\bList\/Util\b/) {
+ print "1..0 # Skip: List::Util was not built\n";
+ exit 0;
+ }
+ }
+ if ($] eq "5.008009" or $] eq "5.010000" or $] le "5.006002") {
+ print "1..0 # Skip: known to fail on $]\n";
+ exit 0;
+ }
+}
+
+use List::Util qw(reduce);
+use Test::More tests => 1;
+
+my $ret = "original";
+$ret = $ret . broken();
+is($ret, "originalreturn");
+
+sub broken {
+ reduce { return "bogus"; } qw/some thing/;
+ return "return";
+}
diff -urN perl-5.10.0.orig/ext/List/Util/t/sum.t perl-5.10.0/ext/List/Util/t/sum.t
--- perl-5.10.0.orig/ext/List/Util/t/sum.t 2007-12-18 11:47:07.000000000 +0100
+++ perl-5.10.0/ext/List/Util/t/sum.t 2009-07-08 17:22:59.000000000 +0200
@@ -13,7 +13,7 @@
}
}
-use Test::More tests => 6;
+use Test::More tests => 8;
use List::Util qw(sum);
@@ -37,3 +37,33 @@
$v = sum(-3.5,3);
is( $v, -0.5, 'real numbers');
+my $one = Foo->new(1);
+my $two = Foo->new(2);
+my $thr = Foo->new(3);
+
+$v = sum($one,$two,$thr);
+is($v, 6, 'overload');
+
+
+{ package Foo;
+
+use overload
+ '""' => sub { ${$_[0]} },
+ '+0' => sub { ${$_[0]} },
+ fallback => 1;
+ sub new {
+ my $class = shift;
+ my $value = shift;
+ bless \$value, $class;
+ }
+}
+
+SKIP: {
+ eval { require bignum; } or skip("Need bignum for testing overloading",1);
+
+ my $v1 = 2**65;
+ my $v2 = 2**65;
+ my $v3 = $v1 + $v2;
+ $v = sum($v1,$v2);
+ is($v, $v3, 'bignum');
+}
diff -urN perl-5.10.0.orig/ext/List/Util/t/weak.t perl-5.10.0/ext/List/Util/t/weak.t
--- perl-5.10.0.orig/ext/List/Util/t/weak.t 2007-12-18 11:47:07.000000000 +0100
+++ perl-5.10.0/ext/List/Util/t/weak.t 2009-07-08 17:23:27.000000000 +0200
@@ -1,10 +1,11 @@
#!./perl
+use strict;
+use Config;
BEGIN {
unless (-d 'blib') {
chdir 't' if -d 't';
@INC = '../lib';
- require Config; import Config;
keys %Config; # Silence warning
if ($Config{extensions} !~ /\bList\/Util\b/) {
print "1..0 # Skip: List::Util was not built\n";
@@ -14,7 +15,7 @@
}
use Scalar::Util ();
-use Test::More (grep { /weaken/ } @Scalar::Util::EXPORT_FAIL)
+use Test::More ((grep { /weaken/ } @Scalar::Util::EXPORT_FAIL) and !$ENV{PERL_CORE})
? (skip_all => 'weaken requires XS version')
: (tests => 22);
@@ -94,9 +95,9 @@
# Case 3: a circular structure
#
-$flag = 0;
+my $flag = 0;
{
- my $y = bless {}, Dest;
+ my $y = bless {}, 'Dest';
Dump($y);
print "# 1: $y\n";
$y->{Self} = $y;
@@ -126,8 +127,8 @@
$flag = 0;
{
- my $y = bless {}, Dest;
- my $x = bless {}, Dest;
+ my $y = bless {}, 'Dest';
+ my $x = bless {}, 'Dest';
$x->{Ref} = $y;
$y->{Ref} = $x;
$x->{Flag} = \$flag;
@@ -140,6 +141,7 @@
# Case 5: deleting a weakref before the other one
#
+my ($y,$z);
{
my $x = "foo";
$y = \$x;
@@ -170,7 +172,7 @@
$b = \$a;
ok(!isweak($b));
-$x = {};
+my $x = {};
weaken($x->{Y} = \$a);
ok(isweak($x->{Y}));
ok(!isweak($x->{Z}));
perl-update-Test-Simple.patch:
MANIFEST | 25
lib/Test/Builder.pm | 1430 +++++++++++-------
lib/Test/Builder/Module.pm | 39
lib/Test/Builder/Tester.pm | 249 +--
lib/Test/Builder/Tester/Color.pm | 5
lib/Test/More.pm | 592 ++++---
lib/Test/Simple.pm | 38
lib/Test/Simple/Changes | 226 ++
lib/Test/Simple/README | 7
lib/Test/Simple/t/BEGIN_require_ok.t | 27
lib/Test/Simple/t/BEGIN_use_ok.t | 26
lib/Test/Simple/t/More.t | 9
lib/Test/Simple/t/bad_plan.t | 29
lib/Test/Simple/t/bail_out.t | 16
lib/Test/Simple/t/c_flag.t | 21
lib/Test/Simple/t/cmp_ok.t | 37
lib/Test/Simple/t/create.t | 21
lib/Test/Simple/t/curr_test.t | 11
lib/Test/Simple/t/current_test.t | 11
lib/Test/Simple/t/current_test_without_plan.t | 16
lib/Test/Simple/t/details.t | 13
lib/Test/Simple/t/diag.t | 67
lib/Test/Simple/t/died.t | 45
lib/Test/Simple/t/done_testing.t | 12
lib/Test/Simple/t/done_testing_double.t | 46
lib/Test/Simple/t/done_testing_plan_mismatch.t | 44
lib/Test/Simple/t/done_testing_with_no_plan.t | 11
lib/Test/Simple/t/done_testing_with_number.t | 12
lib/Test/Simple/t/done_testing_with_plan.t | 11
lib/Test/Simple/t/dont_overwrite_die_handler.t | 19
lib/Test/Simple/t/exit.t | 134 -
lib/Test/Simple/t/explain.t | 27
lib/Test/Simple/t/extra.t | 2
lib/Test/Simple/t/extra_one.t | 2
lib/Test/Simple/t/fail-like.t | 39
lib/Test/Simple/t/fail-more.t | 458 ++++-
lib/Test/Simple/t/fail.t | 62
lib/Test/Simple/t/fail_one.t | 47
lib/Test/Simple/t/filehandles.t | 9
lib/Test/Simple/t/fork_with_new_stdout.t | 54
lib/Test/Simple/t/is_deeply_dne_bug.t | 11
lib/Test/Simple/t/is_deeply_fail.t | 6
lib/Test/Simple/t/is_deeply_with_threads.t | 11
lib/Test/Simple/t/lib/Dev/Null.pm | 8
lib/Test/Simple/t/lib/Dummy.pm | 5
lib/Test/Simple/t/lib/MyOverload.pm | 27
lib/Test/Simple/t/lib/SigDie.pm | 8
lib/Test/Simple/t/maybe_regex.t | 24
lib/Test/Simple/t/missing.t | 8
lib/Test/Simple/t/new_ok.t | 42
lib/Test/Simple/t/no_plan.t | 23
lib/Test/Simple/t/no_plan_at_all.t | 35
lib/Test/Simple/t/no_tests.t | 44
lib/Test/Simple/t/note.t | 30
lib/Test/Simple/t/output.t | 128 -
lib/Test/Simple/t/overload.t | 44
lib/Test/Simple/t/overload_threads.t | 11
lib/Test/Simple/t/plan_bad.t | 5
lib/Test/Simple/t/plan_is_noplan.t | 46
lib/Test/Simple/t/reset.t | 77
lib/Test/Simple/t/reset_outputs.t | 35
lib/Test/Simple/t/skip.t | 2
lib/Test/Simple/t/skipall.t | 41
lib/Test/Simple/t/tbm_doesnt_set_exported_to.t | 24
lib/Test/Simple/t/thread_taint.t | 2
lib/Test/Simple/t/todo.t | 86 +
lib/Test/Simple/t/try.t | 37
lib/Test/Simple/t/undef.t | 32
lib/Test/Simple/t/use_ok.t | 11
lib/Test/Simple/t/utf8.t | 69
lib/Test/Simple/t/versions.t | 21
t/lib/Test/Builder/NoOutput.pm | 122 +
t/lib/Test/Simple/Catch.pm | 6
t/lib/Test/Simple/sample_tests/death.plx | 7
t/lib/Test/Simple/sample_tests/death_with_handler.plx | 20
t/lib/Test/Simple/sample_tests/last_minute_death.plx | 7
t/lib/Test/Simple/sample_tests/too_few_fail.plx | 2
t/lib/TieOut.pm | 8
78 files changed, 3459 insertions(+), 1615 deletions(-)
View full diff with command:
/usr/bin/cvs -n -f diff -kk -u -p -N -r 1.1 -r 1.2 perl-update-Test-Simple.patchIndex: perl-update-Test-Simple.patch
===================================================================
RCS file: /cvs/extras/rpms/perl/F-11/perl-update-Test-Simple.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- perl-update-Test-Simple.patch 11 Mar 2009 21:12:37 -0000 1.1
+++ perl-update-Test-Simple.patch 18 Sep 2009 18:52:12 -0000 1.2
@@ -1,116 +1,13 @@
-Test-Simple-0.86
+Update to 0.92; patch by Iain Arnell <iarnell at gmail.com> (BZ#519417)
-the following made the patch smaller:
-mv Test-Simple-0.86/t/{Builder,Tester,}
-
-diff -urN perl-5.10.0.orig/MANIFEST perl-5.10.0/MANIFEST
---- perl-5.10.0.orig/MANIFEST 2007-12-18 11:47:07.000000000 +0100
-+++ perl-5.10.0/MANIFEST 2009-02-17 17:16:40.000000000 +0100
-@@ -2626,11 +2626,16 @@
- lib/Test/Simple/Changes Test::Simple changes
- lib/Test/Simple.pm Basic utility for writing tests
- lib/Test/Simple/README Test::Simple README
-+lib/Test/Simple/TODO Test::Simple TODO
- lib/Test/Simple/t/00test_harness_check.t Test::Simple test
-+lib/Test/Simple/t/BEGIN_require_ok.t
-+lib/Test/Simple/t/BEGIN_use_ok.t
-+lib/Test/Simple/t/Builder.t Test::Builder tests
-+lib/Test/Simple/t/More.t Test::More test, basic stuff
- lib/Test/Simple/t/bad_plan.t Test::Builder plan() test
- lib/Test/Simple/t/bail_out.t Test::Builder BAIL_OUT test
- lib/Test/Simple/t/buffer.t Test::Builder buffering test
--lib/Test/Simple/t/Builder.t Test::Builder tests
-+lib/Test/Simple/t/c_flag.t
- lib/Test/Simple/t/carp.t Test::Builder test
- lib/Test/Simple/t/circular_data.t Test::Simple test
- lib/Test/Simple/t/cmp_ok.t Test::More test
-@@ -2638,19 +2643,22 @@
- lib/Test/Simple/t/curr_test.t Test::Builder->curr_test tests
- lib/Test/Simple/t/details.t Test::Builder tests
- lib/Test/Simple/t/diag.t Test::More diag() test
-+lib/Test/Simple/t/died.t
-+lib/Test/Simple/t/dont_overwrite_die_handler.t
- lib/Test/Simple/t/eq_set.t Test::Simple test
- lib/Test/Simple/t/exit.t Test::Simple test, exit codes
--lib/Test/Simple/t/extra_one.t Test::Simple test
-+lib/Test/Simple/t/explain.t
- lib/Test/Simple/t/extra.t Test::Simple test
-+lib/Test/Simple/t/extra_one.t Test::Simple test
- lib/Test/Simple/t/fail-like.t Test::More test, like() failures
- lib/Test/Simple/t/fail-more.t Test::More test, tests failing
--lib/Test/Simple/t/fail_one.t Test::Simple test
- lib/Test/Simple/t/fail.t Test::Simple test, test failures
-+lib/Test/Simple/t/fail_one.t Test::Simple test
- lib/Test/Simple/t/filehandles.t Test::Simple test, STDOUT can be played with
- lib/Test/Simple/t/fork.t Test::More fork tests
- lib/Test/Simple/t/harness_active.t Test::Simple test
--lib/Test/Simple/t/has_plan2.t Test::More->plan tests
- lib/Test/Simple/t/has_plan.t Test::Builder->plan tests
-+lib/Test/Simple/t/has_plan2.t Test::More->plan tests
- lib/Test/Simple/t/import.t Test::More test, importing functions
- lib/Test/Simple/t/is_deeply_dne_bug.t Test::More test
- lib/Test/Simple/t/is_deeply_fail.t Test::More test, is_deeply()
-@@ -2660,27 +2668,30 @@
- lib/Test/Simple/t/lib/MyOverload.pm Test::More test module
- lib/Test/Simple/t/maybe_regex.t Test::Builder->maybe_regex() tests
- lib/Test/Simple/t/missing.t Test::Simple test, missing tests
--lib/Test/Simple/t/More.t Test::More test, basic stuff
-+lib/Test/Simple/t/new_ok.t
- lib/Test/Simple/t/no_diag.t Test::Simple test
- lib/Test/Simple/t/no_ending.t Test::Builder test, no_ending()
- lib/Test/Simple/t/no_header.t Test::Builder test, no_header()
- lib/Test/Simple/t/no_plan.t Test::Simple test, forgot the plan
--lib/Test/Simple/TODO Test::Simple TODO
-+lib/Test/Simple/t/no_tests.t
-+lib/Test/Simple/t/note.t
- lib/Test/Simple/t/ok_obj.t Test::Builder object tests
- lib/Test/Simple/t/output.t Test::Builder test, output methods
- lib/Test/Simple/t/overload.t Test::Simple test
- lib/Test/Simple/t/overload_threads.t Test::Simple test
-+lib/Test/Simple/t/plan.t Test::More test, plan()
- lib/Test/Simple/t/plan_bad.t Test::Simple test
- lib/Test/Simple/t/plan_is_noplan.t Test::Simple test, no_plan
- lib/Test/Simple/t/plan_no_plan.t Test::More test, plan() w/no_plan
- lib/Test/Simple/t/plan_shouldnt_import.t Test::Simple test
- lib/Test/Simple/t/plan_skip_all.t Test::More test, plan() w/skip_all
--lib/Test/Simple/t/plan.t Test::More test, plan()
- lib/Test/Simple/t/require_ok.t Test::Simple test
- lib/Test/Simple/t/reset.t Test::Simple test
-+lib/Test/Simple/t/reset_outputs.t
- lib/Test/Simple/t/simple.t Test::Simple test, basic stuff
--lib/Test/Simple/t/skipall.t Test::More test, skip all tests
- lib/Test/Simple/t/skip.t Test::More test, SKIP tests
-+lib/Test/Simple/t/skipall.t Test::More test, skip all tests
-+lib/Test/Simple/t/tbm_doesnt_set_exported_to.t
- lib/Test/Simple/t/tbt_01basic.t Test::Builder::Tester test
- lib/Test/Simple/t/tbt_02fhrestore.t Test::Builder::Tester test
- lib/Test/Simple/t/tbt_03die.t Test::Builder::Tester test
-@@ -2688,13 +2699,14 @@
- lib/Test/Simple/t/tbt_05faildiag.t Test::Builder::Tester test
- lib/Test/Simple/t/tbt_06errormess.t Test::Builder::Tester test
- lib/Test/Simple/t/tbt_07args.t Test::Builder::Tester test
--lib/Test/Simple/t/threads.t Test::Builder thread-safe checks
- lib/Test/Simple/t/thread_taint.t Test::Simple test
-+lib/Test/Simple/t/threads.t Test::Builder thread-safe checks
- lib/Test/Simple/t/todo.t Test::More test, TODO tests
- lib/Test/Simple/t/try.t Test::More test
- lib/Test/Simple/t/undef.t Test::More test, undefs don't cause warnings
--lib/Test/Simple/t/useing.t Test::More test, compile test
- lib/Test/Simple/t/use_ok.t Test::More test, use_ok()
-+lib/Test/Simple/t/useing.t Test::More test, compile test
-+lib/Test/Simple/t/utf8.t
- lib/Test/t/05_about_verbose.t See if Test works
- lib/Test/t/fail.t See if Test works
- lib/Test/t/mix.t See if Test works
diff -urN perl-5.10.0.orig/lib/Test/Builder/Module.pm perl-5.10.0/lib/Test/Builder/Module.pm
--- perl-5.10.0.orig/lib/Test/Builder/Module.pm 2007-12-18 11:47:07.000000000 +0100
-+++ perl-5.10.0/lib/Test/Builder/Module.pm 2009-02-17 17:16:40.000000000 +0100
++++ perl-5.10.0/lib/Test/Builder/Module.pm 2009-08-26 06:14:11.000000000 +0200
@@ -1,24 +1,24 @@
package Test::Builder::Module;
-+# $Id$
-+
-+use strict;
++use strict;
++
use Test::Builder;
require Exporter;
@@ -120,7 +17,8 @@ diff -urN perl-5.10.0.orig/lib/Test/Buil
-$VERSION = '0.72';
-
-use strict;
-+our $VERSION = '0.86';
++our $VERSION = '0.92';
++$VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval)
# 5.004's Exporter doesn't have export_to_level.
my $_export_to_level = sub {
@@ -208,14 +106,20 @@ diff -urN perl-5.10.0.orig/lib/Test/Buil
1;
diff -urN perl-5.10.0.orig/lib/Test/Builder/Tester/Color.pm perl-5.10.0/lib/Test/Builder/Tester/Color.pm
--- perl-5.10.0.orig/lib/Test/Builder/Tester/Color.pm 2007-12-18 11:47:07.000000000 +0100
-+++ perl-5.10.0/lib/Test/Builder/Tester/Color.pm 2009-02-17 17:16:40.000000000 +0100
-@@ -1,4 +1,5 @@
++++ perl-5.10.0/lib/Test/Builder/Tester/Color.pm 2009-08-26 06:14:11.000000000 +0200
+@@ -1,9 +1,11 @@
package Test::Builder::Tester::Color;
-+# $Id$
use strict;
++our $VERSION = "1.18";
+
+ require Test::Builder::Tester;
-@@ -25,8 +26,7 @@
++
+ =head1 NAME
+
+ Test::Builder::Tester::Color - turn on colour in Test::Builder::Tester
+@@ -25,8 +27,7 @@
=cut
@@ -227,10 +131,9 @@ diff -urN perl-5.10.0.orig/lib/Test/Buil
diff -urN perl-5.10.0.orig/lib/Test/Builder/Tester.pm perl-5.10.0/lib/Test/Builder/Tester.pm
--- perl-5.10.0.orig/lib/Test/Builder/Tester.pm 2007-12-18 11:47:07.000000000 +0100
-+++ perl-5.10.0/lib/Test/Builder/Tester.pm 2009-02-17 17:16:40.000000000 +0100
-@@ -1,8 +1,8 @@
++++ perl-5.10.0/lib/Test/Builder/Tester.pm 2009-08-26 06:14:11.000000000 +0200
+@@ -1,8 +1,7 @@
package Test::Builder::Tester;
-+# $Id$
use strict;
-use vars qw(@EXPORT $VERSION @ISA);
@@ -239,7 +142,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Buil
use Test::Builder;
use Symbol;
-@@ -56,21 +56,20 @@
+@@ -56,21 +55,20 @@
###
use Exporter;
@@ -269,7 +172,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Buil
}
sub import {
-@@ -83,14 +82,14 @@
+@@ -83,14 +81,14 @@
$t->plan(@plan);
my @imports = ();
@@ -287,7 +190,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Buil
}
###
-@@ -124,8 +123,7 @@
[...6118 lines suppressed...]
my $out = tie *$out_fh, 'TieOut';
my $err = tie *$err_fh, 'TieOut';
-@@ -13,6 +14,6 @@
+@@ -13,6 +15,6 @@
$t->failure_output($err_fh);
$t->todo_output($err_fh);
@@ -6035,12 +8073,8 @@ diff -urN perl-5.10.0.orig/t/lib/Test/Si
1;
diff -urN perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/death.plx perl-5.10.0/t/lib/Test/Simple/sample_tests/death.plx
--- perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/death.plx 2007-12-18 11:47:08.000000000 +0100
-+++ perl-5.10.0/t/lib/Test/Simple/sample_tests/death.plx 2009-02-17 17:16:41.000000000 +0100
-@@ -1,13 +1,16 @@
- require Test::Simple;
-+# $Id$
-
- push @INC, 't/lib';
++++ perl-5.10.0/t/lib/Test/Simple/sample_tests/death.plx 2009-08-26 06:14:11.000000000 +0200
+@@ -4,10 +4,13 @@
require Test::Simple::Catch;
my($out, $err) = Test::Simple::Catch::caught();
@@ -6054,22 +8088,13 @@ diff -urN perl-5.10.0.orig/t/lib/Test/Si
ok(1);
ok(1);
-die "Knife?";
++$! = 0;
+die "This is a test";
-diff -urN perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/death_in_eval.plx perl-5.10.0/t/lib/Test/Simple/sample_tests/death_in_eval.plx
---- perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/death_in_eval.plx 2007-12-18 11:47:08.000000000 +0100
-+++ perl-5.10.0/t/lib/Test/Simple/sample_tests/death_in_eval.plx 2009-02-17 17:16:41.000000000 +0100
-@@ -1,4 +1,5 @@
- require Test::Simple;
-+# $Id$
- use Carp;
-
- push @INC, 't/lib';
diff -urN perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/death_with_handler.plx perl-5.10.0/t/lib/Test/Simple/sample_tests/death_with_handler.plx
--- perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/death_with_handler.plx 1970-01-01 01:00:00.000000000 +0100
-+++ perl-5.10.0/t/lib/Test/Simple/sample_tests/death_with_handler.plx 2009-02-17 17:16:41.000000000 +0100
-@@ -0,0 +1,19 @@
++++ perl-5.10.0/t/lib/Test/Simple/sample_tests/death_with_handler.plx 2009-08-26 06:14:11.000000000 +0200
+@@ -0,0 +1,20 @@
+require Test::Simple;
-+# $Id$
+
+push @INC, 't/lib';
+require Test::Simple::Catch;
@@ -6086,42 +8111,13 @@ diff -urN perl-5.10.0.orig/t/lib/Test/Si
+
+ok(1);
+ok(1);
++
++$! = 0;
+die "This is a test";
-diff -urN perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/exit.plx perl-5.10.0/t/lib/Test/Simple/sample_tests/exit.plx
---- perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/exit.plx 2007-12-18 11:47:08.000000000 +0100
-+++ perl-5.10.0/t/lib/Test/Simple/sample_tests/exit.plx 2009-02-17 17:16:41.000000000 +0100
-@@ -1,3 +1,4 @@
- require Test::Builder;
-+# $Id$
-
- exit 1;
-diff -urN perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/extras.plx perl-5.10.0/t/lib/Test/Simple/sample_tests/extras.plx
---- perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/extras.plx 2007-12-18 11:47:08.000000000 +0100
-+++ perl-5.10.0/t/lib/Test/Simple/sample_tests/extras.plx 2009-02-17 17:16:41.000000000 +0100
-@@ -1,4 +1,5 @@
- require Test::Simple;
-+# $Id$
-
- push @INC, 't/lib';
- require Test::Simple::Catch;
-diff -urN perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/five_fail.plx perl-5.10.0/t/lib/Test/Simple/sample_tests/five_fail.plx
---- perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/five_fail.plx 2007-12-18 11:47:08.000000000 +0100
-+++ perl-5.10.0/t/lib/Test/Simple/sample_tests/five_fail.plx 2009-02-17 17:16:41.000000000 +0100
-@@ -1,4 +1,5 @@
- require Test::Simple;
-+# $Id$
-
- use lib 't/lib';
- require Test::Simple::Catch;
diff -urN perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/last_minute_death.plx perl-5.10.0/t/lib/Test/Simple/sample_tests/last_minute_death.plx
--- perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/last_minute_death.plx 2007-12-18 11:47:08.000000000 +0100
-+++ perl-5.10.0/t/lib/Test/Simple/sample_tests/last_minute_death.plx 2009-02-17 17:16:41.000000000 +0100
-@@ -1,11 +1,14 @@
- require Test::Simple;
-+# $Id$
-
- push @INC, 't/lib';
- require Test::Simple::Catch;
++++ perl-5.10.0/t/lib/Test/Simple/sample_tests/last_minute_death.plx 2009-08-26 06:14:11.000000000 +0200
+@@ -5,7 +5,9 @@
my($out, $err) = Test::Simple::Catch::caught();
Test::Simple->import(tests => 5);
@@ -6132,86 +8128,31 @@ diff -urN perl-5.10.0.orig/t/lib/Test/Si
ok(1);
ok(1);
-@@ -13,4 +16,4 @@
+@@ -13,4 +15,5 @@
ok(1);
ok(1);
-die "Almost there...";
++$! = 0;
+die "This is a test";
-diff -urN perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/one_fail.plx perl-5.10.0/t/lib/Test/Simple/sample_tests/one_fail.plx
---- perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/one_fail.plx 2007-12-18 11:47:08.000000000 +0100
-+++ perl-5.10.0/t/lib/Test/Simple/sample_tests/one_fail.plx 2009-02-17 17:16:41.000000000 +0100
-@@ -1,4 +1,5 @@
- require Test::Simple;
-+# $Id$
-
- push @INC, 't/lib';
- require Test::Simple::Catch;
-diff -urN perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/pre_plan_death.plx perl-5.10.0/t/lib/Test/Simple/sample_tests/pre_plan_death.plx
---- perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/pre_plan_death.plx 2007-12-18 11:47:08.000000000 +0100
-+++ perl-5.10.0/t/lib/Test/Simple/sample_tests/pre_plan_death.plx 2009-02-17 17:16:41.000000000 +0100
-@@ -1,4 +1,5 @@
- # ID 20020716.013, the exit code would become 0 if the test died
-+# $Id$
- # before a plan.
-
- require Test::Simple;
-diff -urN perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/require.plx perl-5.10.0/t/lib/Test/Simple/sample_tests/require.plx
---- perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/require.plx 2007-12-18 11:47:08.000000000 +0100
-+++ perl-5.10.0/t/lib/Test/Simple/sample_tests/require.plx 2009-02-17 17:16:41.000000000 +0100
-@@ -1 +1,2 @@
- require Test::Simple;
-+# $Id$
-diff -urN perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/success.plx perl-5.10.0/t/lib/Test/Simple/sample_tests/success.plx
---- perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/success.plx 2007-12-18 11:47:08.000000000 +0100
-+++ perl-5.10.0/t/lib/Test/Simple/sample_tests/success.plx 2009-02-17 17:16:41.000000000 +0100
-@@ -1,4 +1,5 @@
- require Test::Simple;
-+# $Id$
-
- push @INC, 't/lib';
- require Test::Simple::Catch;
-diff -urN perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/too_few.plx perl-5.10.0/t/lib/Test/Simple/sample_tests/too_few.plx
---- perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/too_few.plx 2007-12-18 11:47:08.000000000 +0100
-+++ perl-5.10.0/t/lib/Test/Simple/sample_tests/too_few.plx 2009-02-17 17:16:41.000000000 +0100
-@@ -1,4 +1,5 @@
- require Test::Simple;
-+# $Id$
-
- push @INC, 't/lib';
- require Test::Simple::Catch;
diff -urN perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/too_few_fail.plx perl-5.10.0/t/lib/Test/Simple/sample_tests/too_few_fail.plx
--- perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/too_few_fail.plx 2007-12-18 11:47:08.000000000 +0100
-+++ perl-5.10.0/t/lib/Test/Simple/sample_tests/too_few_fail.plx 2009-02-17 17:16:41.000000000 +0100
-@@ -1,4 +1,5 @@
- require Test::Simple;
-+# $Id$
-
- push @INC, 't/lib';
- require Test::Simple::Catch;
-@@ -9,4 +10,4 @@
++++ perl-5.10.0/t/lib/Test/Simple/sample_tests/too_few_fail.plx 2009-08-26 06:14:11.000000000 +0200
+@@ -9,4 +9,4 @@
ok(0);
ok(1);
-ok(0);
\ No newline at end of file
+ok(0);
-diff -urN perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/two_fail.plx perl-5.10.0/t/lib/Test/Simple/sample_tests/two_fail.plx
---- perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/two_fail.plx 2007-12-18 11:47:08.000000000 +0100
-+++ perl-5.10.0/t/lib/Test/Simple/sample_tests/two_fail.plx 2009-02-17 17:16:41.000000000 +0100
-@@ -1,4 +1,5 @@
- require Test::Simple;
-+# $Id$
-
- push @INC, 't/lib';
- require Test::Simple::Catch;
diff -urN perl-5.10.0.orig/t/lib/TieOut.pm perl-5.10.0/t/lib/TieOut.pm
--- perl-5.10.0.orig/t/lib/TieOut.pm 2007-12-18 11:47:08.000000000 +0100
-+++ perl-5.10.0/t/lib/TieOut.pm 2009-02-17 17:16:41.000000000 +0100
-@@ -1,13 +1,14 @@
++++ perl-5.10.0/t/lib/TieOut.pm 2009-08-26 06:14:11.000000000 +0200
+@@ -1,13 +1,15 @@
package TieOut;
-+# $Id$
++use strict;
++
sub TIEHANDLE {
my $scalar = '';
- bless( \$scalar, $_[0]);
@@ -6225,7 +8166,7 @@ diff -urN perl-5.10.0.orig/t/lib/TieOut.
}
sub PRINTF {
-@@ -16,7 +17,7 @@
+@@ -16,7 +18,7 @@
$$self .= sprintf $fmt, @_;
}
Index: perl.spec
===================================================================
RCS file: /cvs/extras/rpms/perl/F-11/perl.spec,v
retrieving revision 1.219
retrieving revision 1.220
diff -u -p -r1.219 -r1.220
--- perl.spec 7 Jul 2009 13:44:39 -0000 1.219
+++ perl.spec 18 Sep 2009 18:52:12 -0000 1.220
@@ -7,7 +7,7 @@
Name: perl
Version: %{perl_version}
-Release: 73%{?dist}
+Release: 82%{?dist}
Epoch: %{perl_epoch}
Summary: Practical Extraction and Report Language
Group: Development/Languages
@@ -18,6 +18,7 @@ Url: http://www.perl.org/
Source0: http://search.cpan.org/CPAN/authors/id/R/RG/RGARCIA/perl-%{perl_version}.tar.gz
Source11: filter-requires.sh
Source12: perl-5.8.0-libnet.cfg
+Source13: macros.perl
# Specific to Fedora/RHEL
Patch1: perl-5.8.0-root.patch
@@ -184,6 +185,21 @@ Patch57: 38_fix_weaken_memleak
# http://rt.perl.org/rt3/Ticket/Display.html?id=39060 (#221113)
Patch58: perl-perlio-incorrect-errno.patch
+# h2ph: generated *.ph files no longer produce warnings when processed
+Patch59: perl-bz509676.patch
+
+# With the Scalar-List-Utils update, more prereq declarations have to
+# be skipped in Makefile.PL files.
+Patch60: perl-skip-prereq.patch
+
+# much better swap logic to support reentrancy and fix assert failure
+# http://perl5.git.perl.org/perl.git/commitdiff/e9105d30edfbaa7f444bc7984c9bafc8e991ad12
+# RT #60508
+Patch61: perl-5.10.0-much-better-swap-logic.patch
+
+# https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6148
+Patch62: perl-5.10.0-spamassassin.patch
+
# Update some of the bundled modules
# see http://fedoraproject.org/wiki/Perl/perl.spec for instructions
Patch100: perl-update-constant.patch
@@ -219,7 +235,7 @@ Patch113: perl-update-Sys-Syslog.patch
Patch114: perl-update-Test-Harness.patch
%define Test_Harness_version 3.16
Patch115: perl-update-Test-Simple.patch
-%define Test_Simple_version 0.86
+%define Test_Simple_version 0.92
Patch116: perl-update-Time-HiRes.patch
%define Time_HiRes_version 1.9719
Patch117: perl-update-Digest-SHA.patch
@@ -229,9 +245,13 @@ Patch118: perl-update-autodie.patch
%define autodie_version 1.999
# cpan has it under PathTools-3.30
Patch119: perl-update-FileSpec.patch
-%define File_Spec_version 3.30
+%define File_Spec_version 3.30
Patch120: perl-update-Compress_Raw_Zlib.patch
-%define Compress_Raw_Zlib 2.020
+%define Compress_Raw_Zlib 2.020
+Patch121: perl-update-Scalar-List-Utils.patch
+%define Scalar_List_Utils 1.21
+Patch122: perl-update-Module-Pluggable.patch
+%define Module_Pluggable_version 3.90
# Fedora uses links instead of lynx
# patches File-Fetch and CPAN
@@ -754,7 +774,7 @@ Group: Development/Libraries
License: GPL+ or Artistic
# Epoch bump for clean upgrade over old standalone package
Epoch: 1
-Version: 3.60
+Version: %{Module_Pluggable_version}
Requires: perl = %{perl_epoch}:%{perl_version}-%{release}
%description Module-Pluggable
@@ -987,6 +1007,10 @@ upstream tarball from perl.org.
%patch56 -p1
%patch57 -p1
%patch58 -p1
+%patch59 -p1
+%patch60 -p1
+%patch61 -p1
+%patch62 -p1
%patch100 -p1
%patch101 -p1
@@ -1009,6 +1033,13 @@ upstream tarball from perl.org.
%patch118 -p1
%patch119 -p1
%patch120 -p1
+%patch121 -p1
+%patch122 -p1
+# 0-byte files and patch don't seem to agree
+mkdir t/Module_Pluggable/lib/Zot/
+touch t/Module_Pluggable/lib/Zot/.Zork.pm
+
+
%patch201 -p1
#
@@ -1068,6 +1099,7 @@ sed -i "s|LIB = ./zlib-src|L
echo "RPM Build arch: %{_arch}"
# use "lib", not %{_lib}, for privlib, sitelib, and vendorlib
+# To build production version, we would need -DDEBUGGING=-g
/bin/sh Configure -des -Doptimize="$RPM_OPT_FLAGS" \
-Accflags="-DPERL_USE_SAFE_PUTENV" \
@@ -1166,6 +1198,13 @@ done
install -p -m 644 %{SOURCE12} %{comp_perl_lib}/Net/libnet.cfg
#
+# perl RPM macros
+#
+
+mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/rpm
+install -p -m 644 %{SOURCE13} ${RPM_BUILD_ROOT}%{_sysconfdir}/rpm/
+
+#
# Core modules removal
#
find $RPM_BUILD_ROOT -name '*NDBM*' | xargs rm -rfv
@@ -1256,6 +1295,10 @@ perl -x patchlevel.h \
'Fedora Patch56: Fix $? when dumping core' \
'34209 Fix a memory leak with Scalar::Util::weaken()' \
'fix RT 39060, errno incorrectly set in perlio' \
+ 'Fedora Patch59: h2ph: generated *.ph files no longer produce warnings when processed' \
+ 'Fedora Patch60: remove PREREQ_FATAL from Makefile.PLs processed by miniperl' \
+ 'Fedora Patch61: much better swap logic to support reentrancy and fix assert failure' \
+ 'Fedora Patch62: spam assassin needs workaround for removing tainted mode' \
'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}' \
@@ -1277,6 +1320,8 @@ perl -x patchlevel.h \
'Fedora Patch117: Update module autodie to %{autodie_version}' \
'Fedora Patch119: Update File::Spec to %{File_Spec_version}' \
'Fedora Patch120: Update Compress::Raw::Zlib to %{Compress_Raw_Zlib}' \
+ 'Fedora Patch121: Update Scalar-List-Utils to %{Scalar_List_Utils}' \
+ 'Fedora Patch122: Update Module-Pluggable to %{Module_Pluggable_version}' \
'Fedora Patch201: Fedora uses links instead of lynx' \
%{nil}
@@ -1602,6 +1647,7 @@ TMPDIR="$PWD/tmp" make test
%{_libdir}/perl5/%{perl_version}/%{perl_archname}/CORE/*.h
%{_bindir}/xsubpp
%{_mandir}/man1/xsubpp*
+%{_sysconfdir}/rpm/macros.perl
%files suidperl
%defattr(-,root,root,-)
@@ -1902,6 +1948,38 @@ TMPDIR="$PWD/tmp" make test
# Old changelog entries are preserved in CVS.
%changelog
+* Mon Aug 31 2009 Chris Weyl <cweyl at alumni.drew.edu> - 4:5.10.0-82
+- update our Test-Simple update to 0.92 (patch by Iain Arnell), #519417
+- update Module-Pluggable to 3.9
+
+* Thu Aug 27 2009 Chris Weyl <cweyl at alumni.drew.edu> - 4:5.10.0-81
+- fix macros.perl *sigh*
+
+* Mon Aug 24 2009 Stepan Kasal <skasal at redhat.com> - 4:5.10.0-80
+- Remove -DDEBUGGING=-g, we are not ready yet.
+
+* Fri Aug 21 2009 Chris Weyl <cweyl at alumni.drew.edu> - 4:5.10.0-79
+- add helper filtering macros to -devel, for perl-* package invocation
+ (#502402)
+
+* Fri Jul 31 2009 Stepan Kasal <skasal at redhat.com> - 4:5.10.0-78
+- Add configure option -DDEBUGGING=-g (#156113)
+
+* Tue Jul 28 2009 arcela Mašláňová <mmaslano at redhat.com> - 4:5.10.0-77
+- 510127 spam assassin suffer from tainted bug
+
+* Mon Jul 27 2009 Marcela Mašláňová <mmaslano at redhat.com> - 4:5.10.0-76
+- 494773 much better swap logic to support reentrancy and fix assert failure (rt #60508)
+
+* Sat Jul 25 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 4:5.10.0-75
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
+
+* Fri Jul 10 2009 Stepan Kasal <skasal at redhat.com> - 4:5.10.0-74
+- fix generated .ph files so that they no longer cause warnings (#509676)
+- remove PREREQ_FATAL from Makefile.PL's processed by miniperl
+- update to latest Scalar-List-Utils (#507378)
+- perl-skip-prereq.patch: skip more prereq declarations in Makefile.PL files
+
* Tue Jul 7 2009 Stepan Kasal <skasal at redhat.com> - 4:5.10.0-73
- re-enable tests
More information about the fedora-extras-commits
mailing list