Browse files

Fixed DESTDIR handling

  • Loading branch information...
1 parent c5c06a8 commit cfdeb2c96d7389c2f44d255a43cec05d740259aa @tadzik committed Dec 25, 2010
Showing with 6 additions and 4 deletions.
  1. +4 −2 bin/neutro
  2. +2 −2 tmplib/Module/Install.pm
View
6 bin/neutro
@@ -10,7 +10,8 @@ use Module::Install;
my $home = ($*VM<config><osname> eq 'MSWin32')
?? %*ENV<HOMEPATH> !! %*ENV<HOME>;
my $CONFIGDIR = "$home/.neutro";
-my $INSTALLDIR = %*ENV<DESTDIR> // "$home/.perl6";
+my $DESTDIR = %*ENV<DESTDIR> ne "" ?? %*ENV<DESTDIR>
+ !! "$home/.perl6";
my $INSTALLED = "$CONFIGDIR/installed";
my $SRCDIR = "$CONFIGDIR/src";
my $STRICT = False;
@@ -118,7 +119,8 @@ sub install (Str $module) {
notice "Installing $module";
try {
- Module::Install::install :dir($path), :v($VERBOSE);
+ Module::Install::install :dir($path), :dest($DESTDIR),
+ :v($VERBOSE);
CATCH {
$fail = True;
}
View
4 tmplib/Module/Install.pm
@@ -9,7 +9,7 @@ sub mkdirp($name as Str) {
}
}
-our sub install(Str :$dir = '.', Str :$dest = "%*ENV<HOME>/.perl6/", :$v) {
+our sub install(Str :$dir = '.', Str :$dest = "%*ENV<HOME>/.perl6", :$v) {
if $*VM<config><osname> ne 'MSWin32'
&& "$dir/Makefile".IO ~~ :f {
my $cwd = cwd;
@@ -30,7 +30,7 @@ our sub install(Str :$dir = '.', Str :$dest = "%*ENV<HOME>/.perl6/", :$v) {
}
}
for @files -> $file {
- my $target-dir = $file.dir.subst(/^$dir\//, $dest);
+ my $target-dir = $file.dir.subst(/^$dir\//, "$dest/");
mkdirp $target-dir;
say "Installing $file" if $v;
if $*VM<config><osname> eq 'MSWin32' {

0 comments on commit cfdeb2c

Please sign in to comment.