3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/misc/nix-static/nix-0.10pre5679.patch
Armijn Hemel aefc9586ec statically linked Nix. This should come in handy for installers...I hope...
svn path=/nixpkgs/trunk/; revision=6016
2006-08-02 10:43:27 +00:00

26 lines
1.1 KiB
Diff

diff -ruN nix-0.10pre5679/scripts/nix-prefetch-url.in nix-0.10pre5679.new/scripts/nix-prefetch-url.in
--- nix-0.10pre5679/scripts/nix-prefetch-url.in 2006-07-11 13:24:20.000000000 +0200
+++ nix-0.10pre5679.new/scripts/nix-prefetch-url.in 2006-08-01 11:54:02.000000000 +0200
@@ -39,10 +39,10 @@
tmpPath=/tmp/nix-prefetch-url-$$ # !!! security?
tmpFile=$tmpPath/$name
- mkdir $tmpPath
+ mkdir -p $NIX_ROOT/$tmpPath
# Perform the download.
- @curl@ --fail --location --max-redirs 20 "$url" > $tmpFile
+ @curl@ --fail --location --max-redirs 20 "$url" > $NIX_ROOT/$tmpFile
# Compute the hash.
hash=$(@bindir@/nix-hash --type "$hashType" $hashFormat --flat $tmpFile)
@@ -51,7 +51,7 @@
# Add the downloaded file to the Nix store.
finalPath=$(@bindir@/nix-store --add-fixed "$hashType" $tmpFile)
- if test -n "$tmpPath"; then rm -rf $tmpPath || true; fi
+ if test -n "$NIX_ROOT/$tmpPath"; then rm -rf $NIX_ROOT/$tmpPath || true; fi
if test -n "$expHash" -a "$expHash" != "$hash"; then
echo "hash mismatch for URL \`$url'"