fetchurl: friendly message if hash is not given
This commit is contained in:
@@ -81,16 +81,16 @@ assert builtins.isList urls;
|
|||||||
assert urls != [] -> url == "";
|
assert urls != [] -> url == "";
|
||||||
assert url != "" -> urls == [];
|
assert url != "" -> urls == [];
|
||||||
|
|
||||||
assert showURLs || (outputHash != "" && outputHashAlgo != "")
|
|
||||||
|| md5 != "" || sha1 != "" || sha256 != "";
|
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
|
hasHash = showURLs || (outputHash != "" && outputHashAlgo != "")
|
||||||
|
|| md5 != "" || sha1 != "" || sha256 != "";
|
||||||
urls_ = if urls != [] then urls else [url];
|
urls_ = if urls != [] then urls else [url];
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
if (!hasHash) then throw "Specify hash for fetchurl fixed-output derivation: ${stdenv.lib.concatStringsSep ", " urls_}" else stdenv.mkDerivation {
|
||||||
name =
|
name =
|
||||||
if showURLs then "urls"
|
if showURLs then "urls"
|
||||||
else if name != "" then name
|
else if name != "" then name
|
||||||
|
|||||||
Reference in New Issue
Block a user