aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/local-store.cc
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-03-23 00:47:16 +0100
committereldritch horrors <pennae@lix.systems>2024-07-05 22:28:16 +0000
commit06220a71c1430c97bfcd8012b00530a987e40e97 (patch)
tree69f230d669db2804379a33fc1ec6e3d3fc908c67 /src/libstore/local-store.cc
parentb51ea465de48e4c5516ba0182cc642b4e644be10 (diff)
libstore: convert dumpPath to a generator
Change-Id: Ic4cf5562504aa29130304469936f958c0426e5ef
Diffstat (limited to 'src/libstore/local-store.cc')
-rw-r--r--src/libstore/local-store.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc
index 6f441a0a1..ce5af0082 100644
--- a/src/libstore/local-store.cc
+++ b/src/libstore/local-store.cc
@@ -1406,7 +1406,7 @@ StorePath LocalStore::addToStoreFromDump(Source & source0, std::string_view name
auto narHash = std::pair { hash, size };
if (method != FileIngestionMethod::Recursive || hashAlgo != htSHA256) {
HashSink narSink { htSHA256 };
- dumpPath(realPath, narSink);
+ narSink << dumpPath(realPath);
narHash = narSink.finish();
}
@@ -1461,7 +1461,7 @@ StorePath LocalStore::addTextToStore(
canonicalisePathMetaData(realPath, {});
StringSink sink;
- dumpString(s, sink);
+ sink << dumpString(s);
auto narHash = hashString(htSHA256, sink.s);
optimisePath(realPath, repair);
@@ -1601,7 +1601,7 @@ bool LocalStore::verifyStore(bool checkContents, RepairFlag repair)
auto hashSink = HashSink(info->narHash.type);
- dumpPath(Store::toRealPath(i), hashSink);
+ hashSink << dumpPath(Store::toRealPath(i));
auto current = hashSink.finish();
if (info->narHash != nullHash && info->narHash != current.first) {
@@ -1895,7 +1895,7 @@ ContentAddress LocalStore::hashCAPath(
[&](const FileIngestionMethod & m2) {
switch (m2) {
case FileIngestionMethod::Recursive:
- dumpPath(path, caSink);
+ caSink << dumpPath(path);
break;
case FileIngestionMethod::Flat:
readFileSource(path)->drainInto(caSink);