X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Flocal%2Flib.pm;h=1153400154e60dacfed58d22e9689c80b5135970;hb=d8b2311a96dc5d2ebc189193515b1fcc4893274c;hp=f68cc768b4e4914584656534147c8763e0d9b6ce;hpb=2164a41e042df0146858507fc2443da2d91f3ffe;p=p5sagit%2Flocal-lib.git diff --git a/lib/local/lib.pm b/lib/local/lib.pm index f68cc76..1153400 100644 --- a/lib/local/lib.pm +++ b/lib/local/lib.pm @@ -66,11 +66,6 @@ DEATH $arg_store{path} = $class->resolve_path($arg_store{path}); $class->setup_local_lib_for($arg_store{path}, $deactivating); - - for (@INC) { # Untaint @INC - next if ref; # Skip entry if it is an ARRAY, CODE, blessed, etc. - m/(.*)/ and $_ = $1; - } } sub pipeline; @@ -430,8 +425,7 @@ sub build_activate_environment_vars_for { $path, \'PERL_LOCAL_LIB_ROOT', ), - PERL_MB_OPT => "--install_base " . _mb_escape_path($path), - PERL_MM_OPT => "INSTALL_BASE=" . _mm_escape_path($path), + $class->installer_options_for($path), PERL5LIB => _env_list_value( { interpolate => $interpolate, exists => 0, empty => '' }, @@ -518,13 +512,21 @@ sub build_deactivate_environment_vars_for { # correspond with the new top of stack. if ($active_lls[0] eq $path) { my $new_top = $active_lls[1]; - $env{PERL_MB_OPT} = defined($new_top) ? "--install_base "._mb_escape_path($new_top) : undef; - $env{PERL_MM_OPT} = defined($new_top) ? "INSTALL_BASE="._mm_escape_path($new_top) : undef; + my %opts = $class->installer_options_for($new_top); + $env{keys %opts} = values %opts; } return %env; } +sub installer_options_for { + my ($class, $path) = @_; + return ( + PERL_MM_OPT => defined $path ? "INSTALL_BASE="._mm_escape_path($path) : undef, + PERL_MB_OPT => defined $path ? "--install_base "._mb_escape_path($path) : undef, + ) +} + sub build_deact_all_environment_vars_for { my ($class, $path, $interpolate) = @_;