From 3e1e56e10c7d8c8bc45ba3e83b6e0086e8b1099c Mon Sep 17 00:00:00 2001 From: "Yury G. Kudryashov" Date: Sat, 1 May 2010 07:07:36 +0000 Subject: [PATCH] fetchurl restricted: list nix-prefetch-url as well svn path=/nixpkgs/trunk/; revision=21474 --- pkgs/build-support/fetchurl/default.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/fetchurl/default.nix b/pkgs/build-support/fetchurl/default.nix index baa6c65b9d4..1ee4946c856 100644 --- a/pkgs/build-support/fetchurl/default.nix +++ b/pkgs/build-support/fetchurl/default.nix @@ -91,7 +91,11 @@ _EOF_ ''; message_ = if message != "" then message else '' You have to download ${name_} from ${stdenv.lib.concatStringsSep " " urls_} yourself, - and add it to the store using "nix-store --add-fixed ${hashAlgo_} ${name_}". + and add it to the store using either + nix-store --add-fixed ${hashAlgo_} ${name_} + or + ${if hashAlgo_ != "sha256" then "NIX_HASH_ALGO=${hashAlgo_} " else + ""}nix-prefetch-url file://path/to/${name_} ''; } else { @@ -119,4 +123,4 @@ else { "NIX_HASHED_MIRRORS" ] ++ (map (site: "NIX_MIRRORS_${site}") sites); }) -) \ No newline at end of file +)