From: matthewt Date: Mon, 4 Aug 2008 12:28:23 +0000 (+0000) Subject: make CPAN config reinit automagic X-Git-Tag: 1.006009~90 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4662123fd45a165ecf9ae4226c83215ba8d04913;p=p5sagit%2Flocal-lib.git make CPAN config reinit automagic git-svn-id: http://dev.catalyst.perl.org/repos/bast/local-lib/1.000/trunk@4728 bd8105ee-0ff8-0310-8827-fb3f25b6796d --- diff --git a/Makefile.PL b/Makefile.PL index 6748804..e8e44be 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -19,6 +19,7 @@ BEGIN { local::lib->import(@args); push(@ARGV,$ENV{PERL_MM_OPT}); + push(@ARGV, map { "-I$_" } split(':',$ENV{PERL5LIB})); system($^X, '-MExtUtils::MakeMaker 6.31', '-e1'); my $eumm = $? >> 8; @@ -30,10 +31,18 @@ BEGIN { system($^X, '-MCPAN', '-e', 'CPAN::Config->load; unless (-w $CPAN::Config->{keep_source_where}) { - $ENV{PERL_MM_USE_DEFAULT} = 0; 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; }' );