From 0ac74d23dc916363c1d6256fa2eae744402bc5c3 Mon Sep 17 00:00:00 2001 From: Armijn Hemel Date: Tue, 1 Aug 2006 18:32:24 +0000 Subject: [PATCH] some NIX_ROOT fixes svn path=/nixpkgs/trunk/; revision=6015 --- pkgs/misc/nix-unstable/default.nix | 4 ++++ pkgs/misc/nix-unstable/nix-0.10pre5679.patch | 25 ++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 pkgs/misc/nix-unstable/nix-0.10pre5679.patch diff --git a/pkgs/misc/nix-unstable/default.nix b/pkgs/misc/nix-unstable/default.nix index 3062e065c5d..ffc72adc99b 100644 --- a/pkgs/misc/nix-unstable/default.nix +++ b/pkgs/misc/nix-unstable/default.nix @@ -16,4 +16,8 @@ stdenv.mkDerivation { }; buildInputs = [aterm bdb perl curl]; inherit storeDir stateDir aterm bdb; + + # uncomment if you want to be able to use nix-prefetch-url when NIX_ROOT + # is set + #patches = [./nix-0.10pre5679.patch]; } diff --git a/pkgs/misc/nix-unstable/nix-0.10pre5679.patch b/pkgs/misc/nix-unstable/nix-0.10pre5679.patch new file mode 100644 index 00000000000..4d72c198941 --- /dev/null +++ b/pkgs/misc/nix-unstable/nix-0.10pre5679.patch @@ -0,0 +1,25 @@ +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'"