forked from lix-project/lix
Don't anticipate hash algo without hash in derivation for now
When we merge with master, the new lack of string types make this case impossible (after parsing). Later, when we actually implemenent CA-derivations, we'll change the types to allow that.
This commit is contained in:
parent
49308ef039
commit
3804e3df9b
|
@ -359,22 +359,10 @@ DerivationType BasicDerivation::type() const
|
||||||
outputs.begin()->second.hash != "")
|
outputs.begin()->second.hash != "")
|
||||||
{
|
{
|
||||||
return DerivationType::CAFixed;
|
return DerivationType::CAFixed;
|
||||||
}
|
} else {
|
||||||
|
|
||||||
auto const algo = outputs.begin()->second.hashAlgo;
|
|
||||||
if (algo != "") {
|
|
||||||
throw Error("Invalid mix of CA and regular outputs");
|
|
||||||
}
|
|
||||||
for (auto & i : outputs) {
|
|
||||||
if (i.second.hash != "") {
|
|
||||||
throw Error("Non-fixed-output derivation has fixed output");
|
|
||||||
}
|
|
||||||
if (i.second.hashAlgo != "") {
|
|
||||||
throw Error("Invalid mix of CA and regular outputs");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return DerivationType::Regular;
|
return DerivationType::Regular;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
DrvHashes drvHashes;
|
DrvHashes drvHashes;
|
||||||
|
|
Loading…
Reference in a new issue