From 406dbb7fce32f7d80b02f560d91c956698b58d6e Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 2 Jun 2020 21:09:15 +0000 Subject: [PATCH] `outputHashAlgo` can be blank so parse accordingly It is blank for SRI hashes. --- src/libstore/builtins/fetchurl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstore/builtins/fetchurl.cc b/src/libstore/builtins/fetchurl.cc index 831431437..770df2927 100644 --- a/src/libstore/builtins/fetchurl.cc +++ b/src/libstore/builtins/fetchurl.cc @@ -63,7 +63,7 @@ void builtinFetchurl(const BasicDerivation & drv, const std::string & netrcData) for (auto hashedMirror : settings.hashedMirrors.get()) try { if (!hasSuffix(hashedMirror, "/")) hashedMirror += '/'; - auto ht = parseHashType(getAttr("outputHashAlgo")); + auto ht = parseHashTypeOpt(getAttr("outputHashAlgo")); auto h = Hash(getAttr("outputHash"), ht); fetch(hashedMirror + printHashType(*h.type) + "/" + h.to_string(Base::Base16, false)); return;