Change 33744 by [EMAIL PROTECTED] on 2008/04/25 02:47:00 Integrate: [ 32907] Upgrade to Module-Load-Conditional-0.24 [ 33405] Update to Module-Load-Conditional-0.26
Affected files ... ... //depot/maint-5.10/perl/lib/Module/Load/Conditional.pm#2 integrate ... //depot/maint-5.10/perl/lib/Module/Load/Conditional/t/01_Module_Load_Conditional.t#2 integrate Differences ... ==== //depot/maint-5.10/perl/lib/Module/Load/Conditional.pm#2 (text) ==== Index: perl/lib/Module/Load/Conditional.pm --- perl/lib/Module/Load/Conditional.pm#1~32694~ 2007-12-22 01:23:09.000000000 -0800 +++ perl/lib/Module/Load/Conditional.pm 2008-04-24 19:47:00.000000000 -0700 @@ -9,7 +9,7 @@ use Carp (); use File::Spec (); use FileHandle (); -use version qw[qv]; +use version; use constant ON_VMS => $^O eq 'VMS'; @@ -18,7 +18,7 @@ $FIND_VERSION $ERROR $CHECK_INC_HASH]; use Exporter; @ISA = qw[Exporter]; - $VERSION = '0.22'; + $VERSION = '0.26'; $VERBOSE = 0; $FIND_VERSION = 1; $CHECK_INC_HASH = 0; @@ -280,8 +280,14 @@ ### use qv(), as it will deal with developer release number ### ie ones containing _ as well. This addresses bug report ### #29348: Version compare logic doesn't handle alphas? + ### + ### Update from JPeacock: apparently qv() and version->new + ### are different things, and we *must* use version->new + ### here, or things like #30056 might start happening $href->{uptodate} = - qv( $args->{version} ) <= qv( $href->{version} ) ? 1 : 0; + version->new( $args->{version} ) <= version->new( $href->{version} ) + ? 1 + : 0; } return $href; @@ -301,7 +307,8 @@ ### regex breaks under -T, we must modifiy it so ### it captures the entire expression, and eval /that/ ### rather than $_, which is insecure. - + my $taint_safe_str = do { $str =~ /(^.*$)/sm; $1 }; + if( $str =~ /(?<!\\)([\$*])(([\w\:\']*)\bVERSION)\b.*\=/ ) { print "Evaluating: $str\n" if $verbose; @@ -321,7 +328,7 @@ local $1$2; \$$2=undef; do { - $str + $taint_safe_str }; \$$2 }; @@ -426,9 +433,14 @@ ### use qv(), as it will deal with developer release number ### ie ones containing _ as well. This addresses bug report ### #29348: Version compare logic doesn't handle alphas? + ### + ### Update from JPeacock: apparently qv() and version->new + ### are different things, and we *must* use version->new + ### here, or things like #30056 might start happening if ( !$args->{nocache} && defined $CACHE->{$mod}->{usable} - && (qv($CACHE->{$mod}->{version}||0) >= qv($href->{$mod})) + && (version->new( $CACHE->{$mod}->{version}||0 ) + >= version->new( $href->{$mod} ) ) ) { $error = loc( q[Already tried to use '%1', which was unsuccessful], $mod); last BLOCK; ==== //depot/maint-5.10/perl/lib/Module/Load/Conditional/t/01_Module_Load_Conditional.t#2 (text) ==== Index: perl/lib/Module/Load/Conditional/t/01_Module_Load_Conditional.t --- perl/lib/Module/Load/Conditional/t/01_Module_Load_Conditional.t#1~32694~ 2007-12-22 01:23:09.000000000 -0800 +++ perl/lib/Module/Load/Conditional/t/01_Module_Load_Conditional.t 2008-04-24 19:47:00.000000000 -0700 @@ -64,8 +64,12 @@ ### and return it @path; }; - - is( $INC{'Module/Load/Conditional.pm'}, + my $inc_path = $INC{'Module/Load/Conditional.pm'}; + if ( $^O eq 'MSWin32' ) { + $inc_path = File::Spec->canonpath( $inc_path ); + $inc_path =~ s{\\}{/}g; # to meet with unix path + } + is( $inc_path, File::Spec::Unix->catfile(@rv_path), q[ Found proper file] ); End of Patch.