use vars qw($bootstrapping);
BEGIN {
- if (grep { /^--bootstrap(?:=(.*))?$/ } @ARGV) {
+ if (my ($x) = grep { /^--bootstrap(?:=.*)?$/ } @ARGV) {
+ @ARGV = grep { !/^--bootstrap(?:=.*)?$/ } @ARGV;
$bootstrapping = 1;
+ $x =~ /^--bootstrap(?:=(.*))?$/;
my @args = (defined $1 ? ($1) : ());
$ENV{PERL_MM_USE_DEFAULT} = 1;
$cpan_command .= 'force("install","ExtUtils::MakeMaker"); ';
}
if ($cpan) {
- $cpan_command .= 'install("CPAN"); ';
+ $cpan_command .= 'force("install","CPAN"); ';
}
if(length $cpan_command) {
system($^X, '-MCPAN', '-e', $cpan_command);
}
}
-sub INTERPOLATE_PATH () { 1 }
-sub LITERAL_PATH () { 0 }
+sub INTERPOLATE_ENV () { 1 }
+sub LITERAL_ENV () { 0 }
sub print_environment_vars_for {
my ($class, $path) = @_;
- my @envs = $class->build_environment_vars_for($path, LITERAL_PATH);
+ my @envs = $class->build_environment_vars_for($path, LITERAL_ENV);
my $out = '';
# rather basic csh detection, goes on the assumption that something won't
sub setup_env_hash_for {
my ($class, $path) = @_;
- my %envs = $class->build_environment_vars_for($path, INTERPOLATE_PATH);
+ my %envs = $class->build_environment_vars_for($path, INTERPOLATE_ENV);
@ENV{keys %envs} = values %envs;
}
PERL5LIB => join(':',
$class->install_base_perl_path($path),
$class->install_base_arch_path($path),
+ ($ENV{PERL5LIB} ?
+ ($interpolate == INTERPOLATE_ENV
+ ? ($ENV{PERL5LIB})
+ : ('$PERL5LIB'))
+ : ())
),
PATH => join(':',
$class->install_base_bin_path($path),
- ($interpolate == INTERPOLATE_PATH
+ ($interpolate == INTERPOLATE_ENV
? $ENV{PATH}
: '$PATH')
),