diff options
author | Matthew Bauer <mjbauer95@gmail.com> | 2020-06-19 14:40:49 -0400 |
---|---|---|
committer | Matthew Bauer <mjbauer95@gmail.com> | 2020-06-19 14:40:49 -0400 |
commit | 7e11cf339988a1b44bbd59377de2a1585387ac83 (patch) | |
tree | cdce4ecf309a84408b4e3952daa7f78c9b825f5b /src/libstore/misc.cc | |
parent | 2796b01e863bf3a6d28cc89bb46c6388d8b73fbc (diff) | |
parent | 984e521392b3f41f7cdab203e5c00f3e00e27a28 (diff) |
Merge remote-tracking branch 'origin/master' into substitute-other-storedir
Diffstat (limited to 'src/libstore/misc.cc')
-rw-r--r-- | src/libstore/misc.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/libstore/misc.cc b/src/libstore/misc.cc index dc991e227..128c3c987 100644 --- a/src/libstore/misc.cc +++ b/src/libstore/misc.cc @@ -111,10 +111,14 @@ void Store::computeFSClosure(const StorePath & startPath, std::optional<std::string> getDerivationCA(const BasicDerivation & drv) { auto outputHashMode = drv.env.find("outputHashMode"); - auto outputHashAlgo = drv.env.find("outputHashAlgo"); auto outputHash = drv.env.find("outputHash"); - if (outputHashMode != drv.env.end() && outputHashAlgo != drv.env.end() && outputHash != drv.env.end()) { - auto ht = parseHashType(outputHashAlgo->second); + + std::optional<HashType> ht = std::nullopt; + auto outputHashAlgo = drv.env.find("outputHashAlgo"); + if (outputHashAlgo != drv.env.end()) + ht = parseHashTypeOpt(outputHashAlgo->second); + + if (outputHashMode != drv.env.end() && outputHash != drv.env.end()) { auto h = Hash(outputHash->second, ht); FileIngestionMethod ingestionMethod; if (outputHashMode->second == "recursive") |