From: hdp Date: Mon, 8 Jun 2009 19:44:47 +0000 (+0000) Subject: make TARGET optional X-Git-Tag: 1.006009~76 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=caac8b2133bbb9d85da33aad93bc5704ca756c04;p=p5sagit%2Flocal-lib.git make TARGET optional git-svn-id: http://dev.catalyst.perl.org/repos/bast/local-lib/1.000/trunk@6546 bd8105ee-0ff8-0310-8827-fb3f25b6796d --- diff --git a/eg/scripted_install.pl b/eg/scripted_install.pl index b62c865..91bb13f 100644 --- a/eg/scripted_install.pl +++ b/eg/scripted_install.pl @@ -6,14 +6,14 @@ 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 $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}; -system($^X, 'Makefile.PL',"--bootstrap=$target") && exit 1; +my $bootstrap = $target ? "--bootstrap=$target" : "--bootstrap" +system($^X, 'Makefile.PL', $bootstrap) && exit 1; system($make, 'test') && exit 1; system($make, 'install') && exit 1;