about summary refs log tree commit diff
diff options
context:
space:
mode:
-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 2c55f9f241d6..186804d8e2da 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"