From: matthewt Date: Thu, 14 Feb 2008 16:24:45 +0000 (+0000) Subject: better bootstrap X-Git-Tag: 1.006009~93 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2Flocal-lib.git;a=commitdiff_plain;h=715c31a002cd186335261a1312345026111de253 better bootstrap git-svn-id: http://dev.catalyst.perl.org/repos/bast/local-lib/1.000/trunk@4082 bd8105ee-0ff8-0310-8827-fb3f25b6796d --- diff --git a/Changes b/Changes index ba9d7c7..d05421b 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,7 @@ Revision history for local::lib + - make bootstrap auto-init CPAN config and set USE_DEFAULT for deps + 1.001000 2007-09-19 - refactored shell command generation - implemented C shell command generation based on this (checks $SHELL} diff --git a/Makefile.PL b/Makefile.PL index f051476..bcfefe7 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -7,6 +7,7 @@ BEGIN { $bootstrapping = 1; my @args = (defined $1 ? ($1) : ()); + $ENV{PERL_MM_USE_DEFAULT} = 1; { local @INC = @INC; unshift(@INC, 'lib'); @@ -24,6 +25,17 @@ BEGIN { my $cpan = $? >> 8; my $cpan_command = ''; + 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; + CPAN::Config->init; + }' + ); + # XXX - remove the force on EUMM once its test suite survive PERL_MM_OPT if ($eumm) { # non-zero exit @@ -35,7 +47,9 @@ BEGIN { if(length $cpan_command) { system($^X, '-MCPAN', '-e', $cpan_command); } - + if ($cpan) { + system($^X, '-MCPAN', '-e', 'CPAN::Config->load; CPAN::Config->commit;'); + } } } diff --git a/lib/local/lib.pm b/lib/local/lib.pm index b6e0dd1..44db092 100644 --- a/lib/local/lib.pm +++ b/lib/local/lib.pm @@ -309,13 +309,15 @@ From the shell - To bootstrap if you don't have local::lib itself installed - - $ perl -MCPAN -eshell # you only need to do this if you don't have a ~/.cpan - cpan> exit + $ perl Makefile.PL --bootstrap $ make test && make install + $ echo 'eval $(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)' >>~/.bashrc + # Or for C shells... + $ /bin/csh % echo $SHELL /bin/csh