fetchurl: allow empty hash

Meant as a companion to https://github.com/NixOS/nix/pull/3674

This just resets outputHash if nothing is passed in.
This commit is contained in:
Matthew Bauer 2020-06-09 01:37:10 -05:00
parent 944a86ed1a
commit f2e9046de5

View file

@ -112,7 +112,7 @@ let
else if sha512 != "" then { outputHashAlgo = "sha512"; outputHash = sha512; }
else if sha256 != "" then { outputHashAlgo = "sha256"; outputHash = sha256; }
else if sha1 != "" then { outputHashAlgo = "sha1"; outputHash = sha1; }
else throw "fetchurl requires a hash for fixed-output derivation: ${lib.concatStringsSep ", " urls_}";
else { outputHashAlgo = "sha256"; outputHash = ""; };
in
stdenvNoCC.mkDerivation {