mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-11 04:02:55 +03:00
fetchurl: friendly message if hash is not given
This commit is contained in:
parent
e9c9437445
commit
909b62fa6e
@ -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 New Issue
Block a user