From: Steve Peters Date: Wed, 9 Jan 2008 02:29:48 +0000 (+0000) Subject: Upgrade to Module-Load-Conditional-0.24 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=aacdad3c65e627efa06177542d8ebd91916480fa;p=p5sagit%2Fp5-mst-13.2.git Upgrade to Module-Load-Conditional-0.24 p4raw-id: //depot/perl@32907 --- diff --git a/lib/Module/Load/Conditional.pm b/lib/Module/Load/Conditional.pm index 2bd92f1..4cabf82 100644 --- a/lib/Module/Load/Conditional.pm +++ b/lib/Module/Load/Conditional.pm @@ -9,7 +9,7 @@ use Locale::Maketext::Simple Style => 'gettext'; use Carp (); use File::Spec (); use FileHandle (); -use version qw[qv]; +use version; use constant ON_VMS => $^O eq 'VMS'; @@ -18,7 +18,7 @@ BEGIN { $FIND_VERSION $ERROR $CHECK_INC_HASH]; use Exporter; @ISA = qw[Exporter]; - $VERSION = '0.22'; + $VERSION = '0.24'; $VERBOSE = 0; $FIND_VERSION = 1; $CHECK_INC_HASH = 0; @@ -280,8 +280,14 @@ sub check_install { ### 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 @@ sub _parse_version { ### 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 =~ /(?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;