mirror of
https://github.com/NixOS/nix
synced 2025-06-27 04:21:16 +02:00
NarAccessor: Run in constant memory
This commit is contained in:
parent
fc84c358d9
commit
0a9da00a10
7 changed files with 57 additions and 37 deletions
|
@ -77,15 +77,15 @@ StorePaths Store::importPaths(Source & source, std::shared_ptr<FSAccessor> acces
|
|||
if (deriver != "")
|
||||
info.deriver = parseStorePath(deriver);
|
||||
|
||||
info.narHash = hashString(htSHA256, *tee.source.data);
|
||||
info.narSize = tee.source.data->size();
|
||||
info.narHash = hashString(htSHA256, *tee.saved.s);
|
||||
info.narSize = tee.saved.s->size();
|
||||
|
||||
// Ignore optional legacy signature.
|
||||
if (readInt(source) == 1)
|
||||
readString(source);
|
||||
|
||||
// Can't use underlying source, which would have been exhausted
|
||||
auto source = StringSource { *tee.source.data };
|
||||
auto source = StringSource { *tee.saved.s };
|
||||
addToStore(info, source, NoRepair, checkSigs, accessor);
|
||||
|
||||
res.push_back(info.path);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue