mirror of
https://github.com/NixOS/nix.git
synced 2024-11-29 18:22:27 +00:00
copyStorePath: Fix hash errors when copying from older store
This commit partially reverts 48662d151b
. When
copying from an older store (in my case a store running Nix 1.11.7), nix would
throw errors about there being no hash. This is fixed by recalculating the hash.
This commit is contained in:
parent
18b4c53f71
commit
49e272f647
@ -588,15 +588,19 @@ void copyStorePath(ref<Store> srcStore, ref<Store> dstStore,
|
||||
|
||||
uint64_t total = 0;
|
||||
|
||||
// FIXME
|
||||
#if 0
|
||||
if (!info->narHash) {
|
||||
StringSink sink;
|
||||
srcStore->narFromPath({storePath}, sink);
|
||||
auto info2 = make_ref<ValidPathInfo>(*info);
|
||||
info2->narHash = hashString(htSHA256, *sink.s);
|
||||
if (!info->narSize) info2->narSize = sink.s->size();
|
||||
if (info->ultimate) info2->ultimate = false;
|
||||
info = info2;
|
||||
|
||||
StringSource source(*sink.s);
|
||||
dstStore->addToStore(*info, source, repair, checkSigs);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (info->ultimate) {
|
||||
auto info2 = make_ref<ValidPathInfo>(*info);
|
||||
|
Loading…
Reference in New Issue
Block a user