diff options
author | Domen Kožar <domen@dev.si> | 2014-11-23 17:10:20 +0100 |
---|---|---|
committer | Domen Kožar <domen@dev.si> | 2014-11-23 17:49:32 +0100 |
commit | 909b62fa6e04aa70c691706beac8ff9c5e806281 (patch) | |
tree | a2849b5929028295b70cb76b341b2861bd37fc4c /pkgs/build-support/fetchurl | |
parent | e9c9437445b22e93217a56e619e4267f7296f3f0 (diff) | |
download | nixpkgs-909b62fa6e04aa70c691706beac8ff9c5e806281.tar nixpkgs-909b62fa6e04aa70c691706beac8ff9c5e806281.tar.gz nixpkgs-909b62fa6e04aa70c691706beac8ff9c5e806281.tar.bz2 nixpkgs-909b62fa6e04aa70c691706beac8ff9c5e806281.tar.lz nixpkgs-909b62fa6e04aa70c691706beac8ff9c5e806281.tar.xz nixpkgs-909b62fa6e04aa70c691706beac8ff9c5e806281.tar.zst nixpkgs-909b62fa6e04aa70c691706beac8ff9c5e806281.zip |
fetchurl: friendly message if hash is not given
Diffstat (limited to 'pkgs/build-support/fetchurl')
-rw-r--r-- | pkgs/build-support/fetchurl/default.nix | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pkgs/build-support/fetchurl/default.nix b/pkgs/build-support/fetchurl/default.nix index c74131a9e60..0fcbf2f3d0d 100644 --- a/pkgs/build-support/fetchurl/default.nix +++ b/pkgs/build-support/fetchurl/default.nix @@ -81,16 +81,16 @@ assert builtins.isList urls; assert urls != [] -> url == ""; assert url != "" -> urls == []; -assert showURLs || (outputHash != "" && outputHashAlgo != "") - || md5 != "" || sha1 != "" || sha256 != ""; let + hasHash = showURLs || (outputHash != "" && outputHashAlgo != "") + || md5 != "" || sha1 != "" || sha256 != ""; urls_ = if urls != [] then urls else [url]; in -stdenv.mkDerivation { +if (!hasHash) then throw "Specify hash for fetchurl fixed-output derivation: ${stdenv.lib.concatStringsSep ", " urls_}" else stdenv.mkDerivation { name = if showURLs then "urls" else if name != "" then name |