Skip to content

Commit

Permalink
Don't anticipate hash algo without hash in derivation for now
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Ericson2314 committed Jun 21, 2020
1 parent 49308ef commit 3804e3d
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions src/libstore/derivations.cc
Original file line number Diff line number Diff line change
Expand Up @@ -359,21 +359,9 @@ DerivationType BasicDerivation::type() const
outputs.begin()->second.hash != "")
{
return DerivationType::CAFixed;
} else {
return DerivationType::Regular;
}

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;
}


Expand Down

0 comments on commit 3804e3d

Please sign in to comment.