fetchurl: friendly message if hash is not given
This commit is contained in:
parent
e9c9437445
commit
909b62fa6e
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue