From: Chris Williams Date: Fri, 23 Oct 2009 11:30:26 +0000 (+0100) Subject: Updated Module::Load::Conditional to cpan version 0.31_01 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1823d11bd0507e10ace531e59b0e992b16466120;p=p5sagit%2Fp5-mst-13.2.git Updated Module::Load::Conditional to cpan version 0.31_01 Changes for 0.31_01 Fri Oct 23 09:47:12 BST 2009 ================================================= * Added DEPRECATED and support for determining if a core module is loaded from perl lib path and setting uptodate accordingly. --- diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index 29adc2b..143dfde 100755 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -1033,7 +1033,7 @@ use File::Glob qw(:case); 'Module::Load::Conditional' => { 'MAINTAINER' => 'kane', - 'DISTRIBUTION' => 'KANE/Module-Load-Conditional-0.30.tar.gz', + 'DISTRIBUTION' => 'BINGOS/Module-Load-Conditional-0.31_01.tar.gz', 'FILES' => q[cpan/Module-Load-Conditional], 'CPAN' => 1, '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 47bafe1..4754011 100644 --- a/cpan/Module-Load-Conditional/lib/Module/Load/Conditional.pm +++ b/cpan/Module-Load-Conditional/lib/Module/Load/Conditional.pm @@ -14,12 +14,13 @@ use version; use constant ON_VMS => $^O eq 'VMS'; BEGIN { - use vars qw[ $VERSION @ISA $VERBOSE $CACHE @EXPORT_OK + use vars qw[ $VERSION @ISA $VERBOSE $CACHE @EXPORT_OK $DEPRECATED $FIND_VERSION $ERROR $CHECK_INC_HASH]; use Exporter; @ISA = qw[Exporter]; - $VERSION = '0.30'; + $VERSION = '0.31_01'; $VERBOSE = 0; + $DEPRECATED = 0; $FIND_VERSION = 1; $CHECK_INC_HASH = 0; @EXPORT_OK = qw[check_install can_load requires]; @@ -136,6 +137,9 @@ uptodate will always be true if the module was found. If no parsable version was found in the module, uptodate will also be true, since C had no way to verify clearly. +See also C<$Module::Load::Conditional::DEPRECATED>, which affects +the outcome of this value. + =back =cut @@ -208,7 +212,7 @@ sub check_install { ($fh) = $dir->[0]->($dir, $file, @{$dir}{1..$#{$dir}}) } elsif (UNIVERSAL::can($dir, 'INC')) { - ($fh) = $dir->INC->($dir, $file); + ($fh) = $dir->INC($file); } if (!UNIVERSAL::isa($fh, 'GLOB')) { @@ -300,6 +304,16 @@ sub check_install { : 0; } + if ( $DEPRECATED and version->new($]) >= version->new('5.011') ) { + require Module::CoreList; + require Config; + + $href->{uptodate} = 0 if + exists $Module::CoreList::version{ 0+$] }{ $args->{module} } and + Module::CoreList::is_deprecated( $args->{module} ) and + $Config::Config{privlibexp} eq $href->{dir}; + } + return $href; } @@ -600,6 +614,15 @@ This holds a string of the last error that happened during a call to C. It is useful to inspect this when C returns C. +=head2 $Module::Load::Conditional::DEPRECATED + +This controls whether C checks if +a dual-life core module has been deprecated. If this is set to +true C will return false to C, if +a dual-life module is found to be loaded from C<$Config{privlibexp}> + +The default is 0; + =head1 See Also C