aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/export-import.cc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-07-21 13:43:20 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-07-21 13:43:20 +0000
commitcdb3f39b64fa9e1d1c85bd3ba3a4b8b1c480bb2c (patch)
tree464053f8d7942ed931e342f0576e85f5586bb0f7 /src/libstore/export-import.cc
parentc58c6165c554d671f87b463c9ab1d47a5d75bbbb (diff)
parent0835447eaacacdb4c1241971c584c88acd274b99 (diff)
Merge remote-tracking branch 'upstream/master' into better-ca-parse-errors
Diffstat (limited to 'src/libstore/export-import.cc')
-rw-r--r--src/libstore/export-import.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/libstore/export-import.cc b/src/libstore/export-import.cc
index e0622fb31..a0fc22264 100644
--- a/src/libstore/export-import.cc
+++ b/src/libstore/export-import.cc
@@ -60,8 +60,10 @@ StorePaths Store::importPaths(Source & source, CheckSigsFlag checkSigs)
if (n != 1) throw Error("input doesn't look like something created by 'nix-store --export'");
/* Extract the NAR from the source. */
- TeeParseSink tee(source);
- parseDump(tee, tee.source);
+ StringSink saved;
+ TeeSource tee { source, saved };
+ ParseSink ether;
+ parseDump(ether, tee);
uint32_t magic = readInt(source);
if (magic != exportMagic)
@@ -77,15 +79,15 @@ StorePaths Store::importPaths(Source & source, CheckSigsFlag checkSigs)
if (deriver != "")
info.deriver = parseStorePath(deriver);
- info.narHash = hashString(htSHA256, *tee.saved.s);
- info.narSize = tee.saved.s->size();
+ info.narHash = hashString(htSHA256, *saved.s);
+ info.narSize = 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.saved.s };
+ auto source = StringSource { *saved.s };
addToStore(info, source, NoRepair, checkSigs);
res.push_back(info.path);