Browse files

Make DESTDIR minimally work during bootstrap

  • Loading branch information...
1 parent e3d78a5 commit 6ca2122d7959ce7c8ba3d2920ee2abd9b0d07614 @japhb japhb committed Aug 20, 2012
Showing with 7 additions and 13 deletions.
  1. +3 −3 bin/panda
  2. +4 −10 bootstrap.pl
View
6 bin/panda
@@ -73,12 +73,12 @@ my $panda;
my $pandadir = "$home/.panda";
mkpath $pandadir unless $pandadir.IO ~~ :d;
- my $projectsfile = "$pandadir/projects.json";
+ my $destdir = %*ENV<DESTDIR> || "$home/.perl6";
+ $destdir = "{cwd}/$destdir" unless $destdir ~~ /^ '/' /;
$panda = Panda.new(
srcdir => "$pandadir/src",
- destdir => %*ENV<DESTDIR> ?? "{cwd}/%*ENV<DESTDIR>"
- !! "$home/.perl6",
+ destdir => $destdir,
statefile => "$pandadir/state",
projectsfile => "$pandadir/projects.json"
);
View
14 bootstrap.pl
@@ -18,21 +18,15 @@
my $oldenv = %*ENV<PERL6LIB> // '';
my $env_sep = $*VM<config><osname> eq 'MSWin32' ?? ';' !! ':';
+my $destdir = %*ENV<DESTDIR> || "$home/.perl6";
+ $destdir = "{cwd}/$destdir" unless $destdir ~~ /^ '/' /;
-
-if %*ENV<DESTDIR> {
- %*ENV<PERL6LIB> ~= "{$env_sep}{cwd}/{%*ENV<DESTDIR>}/lib"
-}
-
+%*ENV<PERL6LIB> ~= "{$env_sep}$destdir/lib";
%*ENV<PERL6LIB> ~= "{$env_sep}{cwd}/ext/File__Tools/lib";
%*ENV<PERL6LIB> ~= "{$env_sep}{cwd}/ext/JSON__Tiny/lib";
%*ENV<PERL6LIB> ~= "{$env_sep}{cwd}/ext/Test__Mock/lib";
%*ENV<PERL6LIB> ~= "{$env_sep}{cwd}/lib";
-shell "perl6 bin/panda install File::Tools JSON::Tiny Test::Mock";
-
-%*ENV<PERL6LIB> = join $env_sep, $oldenv, cwd() ~ '/lib';
-
-shell "perl6 bin/panda install {cwd}";
+shell "perl6 bin/panda install File::Tools JSON::Tiny Test::Mock {cwd}";
unlink "$home/.panda/projects.json";

0 comments on commit 6ca2122

Please sign in to comment.