my $cpan = $? >> 8;
my $cpan_command = '';
- system($^X, '-MCPAN', '-e',
+ my $did_cpan_config = 0;
+ my $cpan_config_command =
'my $done; require ExtUtils::MakeMaker;
my $orig = ExtUtils::MakeMaker->can("prompt");
*ExtUtils::MakeMaker::prompt = sub ($;$) {
delete @{$CPAN::Config}{keys %$CPAN::Config};
$CPAN::Config->{urllist} = $save;
CPAN::Config->init;
- }'
- );
+ }';
$ENV{PERL_MM_USE_DEFAULT} = 1;
$cpan_command .= 'force("install","CPAN"); ';
}
if(length $cpan_command) {
+ system($^X, '-MCPAN', '-e', $cpan_config_command);
+ $did_cpan_config++;
system($^X, '-MCPAN', '-e', $cpan_command);
}
if ($cpan) {
# if we call this code directly, the changes get written to
# $BOOTSTRAP/lib/perl5/CPAN/Config.pm, not where the user expects them to
# be in their ~/.cpan/CPAN/MyConfig.pm.
+ system($^X, '-MCPAN', '-e', $cpan_config_command)
+ unless $did_cpan_config;
system($^X, '-MCPAN',
'-e',
q[CPAN::HandleConfig->load;],