From: matthewt Date: Wed, 6 Aug 2008 12:17:33 +0000 (+0000) Subject: more mangling to try and get cpan config init to work right X-Git-Tag: 1.006009~89 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=279e93810ace0dbfbf5950760ec8e6a994c4e864;p=p5sagit%2Flocal-lib.git more mangling to try and get cpan config init to work right git-svn-id: http://dev.catalyst.perl.org/repos/bast/local-lib/1.000/trunk@4730 bd8105ee-0ff8-0310-8827-fb3f25b6796d --- diff --git a/Makefile.PL b/Makefile.PL index e8e44be..c5e6a21 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -9,7 +9,6 @@ BEGIN { $x =~ /^--bootstrap(?:=(.*))?$/; my @args = (defined $1 ? ($1) : ()); - $ENV{PERL_MM_USE_DEFAULT} = 1; { local @INC = @INC; unshift(@INC, 'lib'); @@ -29,24 +28,26 @@ BEGIN { my $cpan_command = ''; system($^X, '-MCPAN', '-e', - 'CPAN::Config->load; - unless (-w $CPAN::Config->{keep_source_where}) { + 'my $done; require ExtUtils::MakeMaker; + my $orig = ExtUtils::MakeMaker->can("prompt"); + *ExtUtils::MakeMaker::prompt = sub { + if (!$done && $_[0] =~ /manual configuration/) { + $done++; + return "no"; + } + return $orig->(@_); + }; + CPAN::Config->load; + unless ($done || -w $CPAN::Config->{keep_source_where}) { my $save = $CPAN::Config->{urllist}; delete @{$CPAN::Config}{keys %$CPAN::Config}; $CPAN::Config->{urllist} = $save; - my $orig = ExtUtils::MakeMaker->can("prompt"); - my $done; - *ExtUtils::MakeMaker::prompt = sub { - if (!$done && $_[0] =~ /manual configuration/) { - $done++; - return "no"; - } - return $orig->(@_); - }; CPAN::Config->init; }' ); + $ENV{PERL_MM_USE_DEFAULT} = 1; + # XXX - remove the force on EUMM once its test suite survive PERL_MM_OPT if ($eumm) { # non-zero exit