X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=eg%2Fscripted_install.pl;h=58f51a4f2e157a3f50a33cccc5b72d3ff34637d2;hb=8468f123ab2f3e8b8b6ab4f81784772041cf245f;hp=b62c865ca5f7a1be6c297622a890e4e75dc7b5e5;hpb=9a021b2b54372f72e6c17f3add625c94b2bb5a98;p=p5sagit%2Flocal-lib.git diff --git a/eg/scripted_install.pl b/eg/scripted_install.pl index b62c865..58f51a4 100644 --- a/eg/scripted_install.pl +++ b/eg/scripted_install.pl @@ -1,19 +1,19 @@ -#!/usr/bin/perl -# contributed by hdp@cpan.org - -use strict; -use warnings; -use CPAN; -use Cwd; -use File::Spec; -my $target = Cwd::abs_path($ENV{TARGET}) - or die "set \$ENV{TARGET} to your desired local::lib dir\n"; - -my $mod = CPAN::Shell->expand(Module => "local::lib"); -$mod->get; -my $dir = CPAN::Shell->expand(Distribution => $mod->cpan_file)->dir; -chdir($dir); -my $make = $CPAN::Config->{make}; -system($^X, 'Makefile.PL',"--bootstrap=$target") && exit 1; -system($make, 'test') && exit 1; -system($make, 'install') && exit 1; +#!/usr/bin/perl +# contributed by hdp@cpan.org + +use strict; +use warnings; +use CPAN; +use Cwd; +use File::Spec; +my $target = $ENV{TARGET} ? Cwd::abs_path($ENV{TARGET}) : undef; + +my $mod = CPAN::Shell->expand(Module => "local::lib"); +$mod->get; +my $dir = CPAN::Shell->expand(Distribution => $mod->cpan_file)->dir; +chdir($dir); +my $make = $CPAN::Config->{make}; +my $bootstrap = $target ? "--bootstrap=$target" : "--bootstrap"; +system($^X, 'Makefile.PL', $bootstrap) && exit 1; +system($make, 'test') && exit 1; +system($make, 'install') && exit 1;