mirror of
https://github.com/NixOS/nix.git
synced 2025-12-02 07:00:59 +01:00
Merge remote-tracking branch 'upstream/master' into enum-class
This commit is contained in:
commit
40526fbea5
158 changed files with 3027 additions and 1816 deletions
|
|
@ -36,7 +36,7 @@ std::unique_ptr<Input> inputFromAttrs(const Attrs & attrs)
|
|||
if (res) {
|
||||
if (auto narHash = maybeGetStrAttr(attrs, "narHash"))
|
||||
// FIXME: require SRI hash.
|
||||
res->narHash = Hash(*narHash);
|
||||
res->narHash = newHashAllowEmpty(*narHash, HashType::Unknown);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
|
@ -47,7 +47,7 @@ Attrs Input::toAttrs() const
|
|||
{
|
||||
auto attrs = toAttrsInternal();
|
||||
if (narHash)
|
||||
attrs.emplace("narHash", narHash->to_string(Base::SRI));
|
||||
attrs.emplace("narHash", narHash->to_string(Base::SRI, true));
|
||||
attrs.emplace("type", type());
|
||||
return attrs;
|
||||
}
|
||||
|
|
@ -67,7 +67,7 @@ std::pair<Tree, std::shared_ptr<const Input>> Input::fetchTree(ref<Store> store)
|
|||
|
||||
if (narHash && narHash != input->narHash)
|
||||
throw Error("NAR hash mismatch in input '%s' (%s), expected '%s', got '%s'",
|
||||
to_string(), tree.actualPath, narHash->to_string(Base::SRI), input->narHash->to_string(Base::SRI));
|
||||
to_string(), tree.actualPath, narHash->to_string(Base::SRI, true), input->narHash->to_string(Base::SRI, true));
|
||||
|
||||
return {std::move(tree), input};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue