* Use absolute paths.

This commit is contained in:
Eelco Dolstra 2005-01-14 13:50:00 +00:00
parent 63791eb05b
commit 9ee88bb2f2
2 changed files with 8 additions and 8 deletions

View file

@ -73,7 +73,7 @@ addToQueue $targetPath;
sub isValidPath { sub isValidPath {
my $p = shift; my $p = shift;
system "nix-store --isvalid '$p' 2> /dev/null"; system "@bindir@/nix-store --isvalid '$p' 2> /dev/null";
return $? == 0; return $? == 0;
} }
@ -96,7 +96,7 @@ while ($queueFront < scalar @queue) {
foreach my $patch (@{$patchList}) { foreach my $patch (@{$patchList}) {
if (isValidPath($patch->{basePath})) { if (isValidPath($patch->{basePath})) {
# !!! this should be cached # !!! this should be cached
my $hash = `nix-hash "$patch->{basePath}"`; my $hash = `@bindir@/nix-hash "$patch->{basePath}"`;
chomp $hash; chomp $hash;
# print " MY HASH is $hash\n"; # print " MY HASH is $hash\n";
if ($hash ne $patch->{baseHash}) { if ($hash ne $patch->{baseHash}) {
@ -177,7 +177,7 @@ sub downloadFile {
my $hash = shift; my $hash = shift;
$ENV{"PRINT_PATH"} = 1; $ENV{"PRINT_PATH"} = 1;
$ENV{"QUIET"} = 1; $ENV{"QUIET"} = 1;
my ($hash2, $path) = `nix-prefetch-url '$url' '$hash'`; my ($hash2, $path) = `@bindir@/nix-prefetch-url '$url' '$hash'`;
chomp $hash2; chomp $hash2;
chomp $path; chomp $path;
die "hash mismatch" if $hash ne $hash2; die "hash mismatch" if $hash ne $hash2;
@ -210,7 +210,7 @@ while (scalar @path > 0) {
# Turn the base path into a NAR archive, to which we can # Turn the base path into a NAR archive, to which we can
# actually apply the patch. # actually apply the patch.
print " packing base path...\n"; print " packing base path...\n";
system "nix-store --dump $patch->{basePath} > /tmp/nar"; system "@bindir@/nix-store --dump $patch->{basePath} > /tmp/nar";
die "cannot dump `$patch->{basePath}'" if ($? != 0); die "cannot dump `$patch->{basePath}'" if ($? != 0);
# Apply the patch. # Apply the patch.
@ -220,7 +220,7 @@ while (scalar @path > 0) {
# Unpack the resulting NAR archive into the target path. # Unpack the resulting NAR archive into the target path.
print " unpacking patched archive...\n"; print " unpacking patched archive...\n";
system "nix-store --restore $v < /tmp/nar2"; system "@bindir@/nix-store --restore $v < /tmp/nar2";
die "cannot unpack /tmp/nar2 into `$v'" if ($? != 0); die "cannot unpack /tmp/nar2 into `$v'" if ($? != 0);
} }
@ -236,7 +236,7 @@ while (scalar @path > 0) {
# Unpack the archive into the target path. # Unpack the archive into the target path.
print " unpacking archive...\n"; print " unpacking archive...\n";
system "bunzip2 < '$narFilePath' | nix-store --restore '$v'"; system "@bunzip2@ < '$narFilePath' | nix-store --restore '$v'";
die "cannot unpack `$narFilePath' into `$v'" if ($? != 0); die "cannot unpack `$narFilePath' into `$v'" if ($? != 0);
} }
} }

View file

@ -19,11 +19,11 @@ for i in "$@"; do
extraArgs="$extraArgs $i" extraArgs="$extraArgs $i"
;; ;;
*) *)
storeExprs=$(nix-instantiate "$i") storeExprs=$(@bindir@/nix-instantiate "$i")
for j in $storeExprs; do for j in $storeExprs; do
echo "store expression is $j" >&2 echo "store expression is $j" >&2
done done
outPaths=$(nix-store -qnfv $extraArgs $storeExprs) outPaths=$(@bindir@/nix-store -qnfv $extraArgs $storeExprs)
for j in $outPaths; do for j in $outPaths; do
echo "$j" echo "$j"
if test -z "$noLink"; then if test -z "$noLink"; then