mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 08:53:21 +00:00
fetchurl: disallow specifying both sha256
and hash
A full check would be more complicated to write -
and more importantly - probably also more expensive.
Motivation: eval-time catch for errors like in commit 8198636be0
.
This commit is contained in:
parent
59d13713c2
commit
cb704bf922
@ -117,6 +117,9 @@ let
|
||||
else throw "fetchurl requires either `url` or `urls` to be set";
|
||||
|
||||
hash_ =
|
||||
# Many other combinations don't make sense, but this is the most common one:
|
||||
if hash != "" && sha256 != "" then throw "multiple hashes passed to fetchurl" else
|
||||
|
||||
if hash != "" then { outputHashAlgo = null; outputHash = hash; }
|
||||
else if md5 != "" then throw "fetchurl does not support md5 anymore, please use sha256 or sha512"
|
||||
else if (outputHash != "" && outputHashAlgo != "") then { inherit outputHashAlgo outputHash; }
|
||||
|
Loading…
Reference in New Issue
Block a user