diff options
author | 2019-02-13 21:15:00 +0000 | |
---|---|---|
committer | 2019-02-13 21:15:00 +0000 | |
commit | 9f11ffb7133c203312a01e4b986886bc88c7d74b (patch) | |
tree | 6618511204c614b20256e4ef9dea39a7b311d638 /gnu/usr.bin/perl/cpan/Module-Load-Conditional/lib/Module | |
parent | Import perl-5.28.1 (diff) | |
download | wireguard-openbsd-9f11ffb7133c203312a01e4b986886bc88c7d74b.tar.xz wireguard-openbsd-9f11ffb7133c203312a01e4b986886bc88c7d74b.zip |
Fix merge issues, remove excess files - match perl-5.28.1 dist
looking good sthen@, Great! bluhm@
Diffstat (limited to 'gnu/usr.bin/perl/cpan/Module-Load-Conditional/lib/Module')
-rw-r--r-- | gnu/usr.bin/perl/cpan/Module-Load-Conditional/lib/Module/Load/Conditional.pm | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/gnu/usr.bin/perl/cpan/Module-Load-Conditional/lib/Module/Load/Conditional.pm b/gnu/usr.bin/perl/cpan/Module-Load-Conditional/lib/Module/Load/Conditional.pm index ace55ad845d..89e22b57207 100644 --- a/gnu/usr.bin/perl/cpan/Module-Load-Conditional/lib/Module/Load/Conditional.pm +++ b/gnu/usr.bin/perl/cpan/Module-Load-Conditional/lib/Module/Load/Conditional.pm @@ -19,14 +19,15 @@ use constant QUOTE => do { ON_WIN32 ? q["] : q['] }; BEGIN { use vars qw[ $VERSION @ISA $VERBOSE $CACHE @EXPORT_OK $DEPRECATED - $FIND_VERSION $ERROR $CHECK_INC_HASH]; + $FIND_VERSION $ERROR $CHECK_INC_HASH $FORCE_SAFE_INC ]; use Exporter; @ISA = qw[Exporter]; - $VERSION = '0.64'; + $VERSION = '0.68'; $VERBOSE = 0; $DEPRECATED = 0; $FIND_VERSION = 1; $CHECK_INC_HASH = 0; + $FORCE_SAFE_INC = 0; @EXPORT_OK = qw[check_install can_load requires]; } @@ -201,6 +202,8 @@ sub check_install { ### so scan the dirs unless( $filename ) { + local @INC = @INC[0..$#INC-1] if $FORCE_SAFE_INC && $INC[-1] eq '.'; + DIR: for my $dir ( @INC ) { my $fh; @@ -307,6 +310,7 @@ sub check_install { } if ( $DEPRECATED and "$]" >= 5.011 ) { + local @INC = @INC[0..$#INC-1] if $FORCE_SAFE_INC && $INC[-1] eq '.'; require Module::CoreList; require Config; @@ -444,6 +448,8 @@ sub can_load { if ( $CACHE->{$mod}->{uptodate} ) { + local @INC = @INC[0..$#INC-1] if $FORCE_SAFE_INC && $INC[-1] eq '.'; + if ( $args->{autoload} ) { my $who = (caller())[0]; eval { autoload_remote $who, $mod }; @@ -509,6 +515,8 @@ sub requires { return undef; } + local @INC = @INC[0..$#INC-1] if $FORCE_SAFE_INC && $INC[-1] eq '.'; + my $lib = join " ", map { qq["-I$_"] } @INC; my $oneliner = 'print(join(qq[\n],map{qq[BONG=$_]}keys(%INC)),qq[\n])'; my $cmd = join '', qq["$^X" $lib -M$who -e], QUOTE, $oneliner, QUOTE; @@ -562,6 +570,12 @@ you. The default is 0; +=head2 $Module::Load::Conditional::FORCE_SAFE_INC + +This controls whether C<Module::Load::Conditional> sanitises C<@INC> +by removing "C<.>". The current default setting is C<0>, but this +may change in a future release. + =head2 $Module::Load::Conditional::CACHE This holds the cache of the C<can_load> function. If you explicitly |