From 5e52df18fefb188b7c7a8e917ebeb8ea1f5ed95a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 10 Aug 2007 00:22:21 +0000 Subject: [PATCH] * Don't rely on /dev/stdin. --- scripts/nix-prefetch-url.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/nix-prefetch-url.in b/scripts/nix-prefetch-url.in index 2c55f9f24..186804d8e 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"