aboutsummaryrefslogtreecommitdiff
path: root/src/libstore
diff options
context:
space:
mode:
authorCarlo Nucera <carlo.nucera@protonmail.com>2020-06-16 12:45:36 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-06-17 22:07:22 +0000
commitfb05a6adcfe0362249bd16527a2e44ea2611e5f3 (patch)
tree90b2d981658ddf4c2b327004d99bc2f5f1e08ef0 /src/libstore
parent3078404e355f900c2afb918307c0deefae5a13c1 (diff)
Eliminate old TeeSink abstraction
This was introduced in fa125b9b28bea25a4eeb4d39a71a481563127cb9, and then "reverted" in 1cf480110879ffc8aee94b4b75999da405b71d7c, except that revert left the struct around doing nothing useful. We're removing it all the way now because we want to make a new `TeeSink` complementing the already-exiting `TeeSource`, that is actually a completely different concept as far as the class hierarchy is concerned.
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/daemon.cc7
-rw-r--r--src/libstore/export-import.cc11
2 files changed, 10 insertions, 8 deletions
diff --git a/src/libstore/daemon.cc b/src/libstore/daemon.cc
index e370e278c..b2e37c5b5 100644
--- a/src/libstore/daemon.cc
+++ b/src/libstore/daemon.cc
@@ -721,9 +721,10 @@ static void performOp(TunnelLogger * logger, ref<Store> store,
if (GET_PROTOCOL_MINOR(clientVersion) >= 21)
source = std::make_unique<TunnelSource>(from, to);
else {
- TeeSink tee(from);
- parseDump(tee, tee.source);
- saved = std::move(*tee.source.data);
+ TeeSource tee(from);
+ ParseSink sink;
+ parseDump(sink, tee);
+ saved = std::move(*tee.data);
source = std::make_unique<StringSource>(saved);
}
diff --git a/src/libstore/export-import.cc b/src/libstore/export-import.cc
index cb9da027d..0e33fb687 100644
--- a/src/libstore/export-import.cc
+++ b/src/libstore/export-import.cc
@@ -77,8 +77,9 @@ StorePaths Store::importPaths(Source & source, std::shared_ptr<FSAccessor> acces
if (n != 1) throw Error("input doesn't look like something created by 'nix-store --export'");
/* Extract the NAR from the source. */
- TeeSink tee(source);
- parseDump(tee, tee.source);
+ TeeSource tee(source);
+ ParseSink sink;
+ parseDump(sink, tee);
uint32_t magic = readInt(source);
if (magic != exportMagic)
@@ -94,15 +95,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.data);
+ info.narSize = tee.data->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.data };
addToStore(info, source, NoRepair, checkSigs, accessor);
res.push_back(info.path);