about summary refs log tree commit diff
path: root/scripts/nix-prefetch-url.in
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2007-08-10T00·22+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2007-08-10T00·22+0000
commit5e52df18fefb188b7c7a8e917ebeb8ea1f5ed95a (patch)
tree2aa8d6c5db4927cbefb2d79637c700ac5ac79fd6 /scripts/nix-prefetch-url.in
parentc5e934dcc9f3c0e75cd14fd7dbab6048abf907d1 (diff)
* Don't rely on /dev/stdin.
Diffstat (limited to 'scripts/nix-prefetch-url.in')
-rw-r--r--scripts/nix-prefetch-url.in3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/nix-prefetch-url.in b/scripts/nix-prefetch-url.in
index 2c55f9f241..186804d8e2 100644
--- a/scripts/nix-prefetch-url.in
+++ b/scripts/nix-prefetch-url.in
@@ -56,7 +56,8 @@ if test -z "$finalPath"; then
     # the file *contents* is done in Nix store, where it can be
     # garbage-collected independently.
     if test -n "$NIX_DOWNLOAD_CACHE"; then
-        urlHash="$(echo -n "$url" | nix-hash --type sha256 --base32 --flat /dev/stdin)"
+        echo -n "$url" > $tmpPath/url
+        urlHash=$(nix-hash --type sha256 --base32 --flat $tmpPath/url)
         echo "$url" > "$NIX_DOWNLOAD_CACHE/$urlHash.url"
         cachedHashFN="$NIX_DOWNLOAD_CACHE/$urlHash.$hashType"
         cachedTimestampFN="$NIX_DOWNLOAD_CACHE/$urlHash.stamp"