Update bootstrapping for local::lib 1.006000.
Dan Brook [Sat, 1 May 2010 23:36:25 +0000 (00:36 +0100)]
As local::lib has stopped supporting the "--self-contained" flag the
relevant code needed updating.
Also added the JSON::XS dependency.

Makefile.PL
script/bootstrap.pl
script/env

index 7b519ec..065f22a 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env perl
+
 use FindBin;
 BEGIN { do "$FindBin::Bin/script/env" or die $@ }
 
@@ -95,6 +96,7 @@ requires 'File::Type::WebImages';
 requires 'File::Which';
 requires 'HTML::Entities';
 requires 'IPC::Run';
+requires 'JSON::XS';
 requires 'List::MoreUtils';
 requires 'Path::Class' => '0.17';
 requires 'Sub::Exporter';
index 1c302ce..269f899 100644 (file)
@@ -46,11 +46,13 @@ lib->import("$target/lib/perl5");
 local %CPAN::Config;
 require CPAN::HandleConfig;
 CPAN::HandleConfig->load();
-$CPAN::Config->{prefs_dir} = "~/.cpan/prefs";
+$CPAN::Config->{prefs_dir} = "$ENV{HOME}/.cpan/prefs";
 
 force(qw/install local::lib/);
 
+require lib::core::only; # Turn lib::core:only on
 require local::lib; # Turn local::lib on
+lib::core::only->import();
 local::lib->import( $target );
 
 # Become fully self contained
@@ -60,7 +62,8 @@ $ENV{PERL5LIB} = ""; # If we used a local::lib to bootstrap, this kills it.
 $ENV{PERL_AUTOINSTALL_PREFER_CPAN}=1;
 $ENV{PERL_MM_OPT} .= " INSTALLMAN1DIR=none INSTALLMAN3DIR=none";
 
-local::lib->import( '--self-contained', $target );
+lib::core::only->import();
+local::lib->import( $target );
 
 # Force a re-install of local::lib here to get the dependencies for local::lib
 # It requires things which ensure we have an unfucked toolchain :)
@@ -70,6 +73,8 @@ force(qw/install local::lib/);
 install('Module::Install');
 install('YAML');
 install('CPAN');
+# For some reason this isn't installed along with M::I::Catalyst.
+install('File::Copy::Recursive');
 install('Module::Install::Catalyst');
 
 print "local::lib setup, type perl Makefile.PL && make installdeps to install dependencies";
index d7c7686..7f96991 100755 (executable)
@@ -63,8 +63,10 @@ if ( $on ) {
 
     $ENV{PERL_MM_OPT} .= " INSTALLMAN1DIR=none INSTALLMAN3DIR=none";
 
+    require lib::core::only;
     require local::lib;
-    local::lib->import( '--self-contained', $target );
+    lib::core::only->import();
+    local::lib->import( $target );
 }
 
 unless ( caller ) {