mirror of
https://github.com/NixOS/nix
synced 2025-07-01 20:51:48 +02:00
RemoteStore::addToStore(): Pass content-addressability assertion
... and use this in Downloader::downloadCached(). This fixes $ nix-build https://nixos.org/channels/nixos-16.09-small/nixexprs.tar.xz -A hello error: cannot import path ‘/nix/store/csfbp1s60dkgmk9f8g0zk0mwb7hzgabd-nixexprs.tar.xz’ because it lacks a valid signature
This commit is contained in:
parent
fe2db1dae5
commit
f023f64f40
6 changed files with 16 additions and 3 deletions
|
@ -612,6 +612,7 @@ Path Downloader::downloadCached(ref<Store> store, const string & url_, bool unpa
|
|||
Hash hash = hashString(expectedHash ? expectedHash.type : htSHA256, *res.data);
|
||||
info.path = store->makeFixedOutputPath(false, hash, name);
|
||||
info.narHash = hashString(htSHA256, *sink.s);
|
||||
info.ca = makeFixedOutputCA(false, hash);
|
||||
store->addToStore(info, sink.s, false, true);
|
||||
storePath = info.path;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue