From: Chris Williams Date: Fri, 23 Apr 2010 15:11:39 +0000 (+0100) Subject: Update Module::Load::Conditional to CPAN version 0.38 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6ba8cc3796ec7d9118fe777db057a603fcc4595d;p=p5sagit%2Fp5-mst-13.2.git Update Module::Load::Conditional to CPAN version 0.38 Addresses a serious problem with CPANPLUS and behaviour of version-0.82. Checking for out of date modules with 'o' in CPANPLUS blows up if any modules that are installed have non-numeric version strings. Extract from Changelog: Changes for 0.38 Fri Apr 23 15:52:38 BST 2010 ================================================= * New release of version raises exceptions on parse errors. Use eval to guard ourselves against this. Changes for 0.36 Tue Feb 9 14:16:21 GMT 2010 ================================================= * Apply patch from Pavel Shaydo RT #53546 to improve the performance of _parse_version() --- diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index 2e6075a..fd8001b 100755 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -958,7 +958,7 @@ use File::Glob qw(:case); 'Module::Load::Conditional' => { 'MAINTAINER' => 'kane', - 'DISTRIBUTION' => 'BINGOS/Module-Load-Conditional-0.34.tar.gz', + 'DISTRIBUTION' => 'BINGOS/Module-Load-Conditional-0.38.tar.gz', 'FILES' => q[cpan/Module-Load-Conditional], 'UPSTREAM' => 'cpan', }, diff --git a/cpan/Module-Load-Conditional/lib/Module/Load/Conditional.pm b/cpan/Module-Load-Conditional/lib/Module/Load/Conditional.pm index 850a7b6..1bceb44 100644 --- a/cpan/Module-Load-Conditional/lib/Module/Load/Conditional.pm +++ b/cpan/Module-Load-Conditional/lib/Module/Load/Conditional.pm @@ -18,7 +18,7 @@ BEGIN { $FIND_VERSION $ERROR $CHECK_INC_HASH]; use Exporter; @ISA = qw[Exporter]; - $VERSION = '0.34'; + $VERSION = '0.38'; $VERBOSE = 0; $DEPRECATED = 0; $FIND_VERSION = 1; @@ -298,10 +298,18 @@ sub check_install { ### 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} = + + ### We have to wrap this in an eval as version-0.82 raises + ### exceptions and not warnings now *sigh* + + eval { + + $href->{uptodate} = version->new( $args->{version} ) <= version->new( $href->{version} ) ? 1 : 0; + + }; } if ( $DEPRECATED and version->new($]) >= version->new('5.011') ) { @@ -322,6 +330,9 @@ sub _parse_version { my $str = shift or return; my $verbose = shift or 0; + ### skip lines which doesn't contain VERSION + return unless $str =~ /VERSION/; + ### skip commented out lines, they won't eval to anything. return if $str =~ /^\s*#/;