aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/store-api.cc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-08-04 18:35:33 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-08-04 18:35:33 +0000
commitfbeb8695fb0d67d0be0da78535b0a1e1a8739a5b (patch)
treeec426c43b1a92ce3cd784b4dfe6ad4bb3e660d3b /src/libstore/store-api.cc
parentb6d97fdbf4f668d72e93e94e956a19ddb299bcd2 (diff)
parent5b22a2c0d443ce1156f361af2dcb142d270daa6c (diff)
Merge remote-tracking branch 'upstream/master' into drv-outputs-map-allow-missing
Diffstat (limited to 'src/libstore/store-api.cc')
-rw-r--r--src/libstore/store-api.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc
index f46e22874..4c68709ef 100644
--- a/src/libstore/store-api.cc
+++ b/src/libstore/store-api.cc
@@ -239,6 +239,20 @@ StorePath Store::computeStorePathForText(const string & name, const string & s,
}
+StorePath Store::addToStore(const string & name, const Path & _srcPath,
+ FileIngestionMethod method, HashType hashAlgo, PathFilter & filter, RepairFlag repair)
+{
+ Path srcPath(absPath(_srcPath));
+ auto source = sinkToSource([&](Sink & sink) {
+ if (method == FileIngestionMethod::Recursive)
+ dumpPath(srcPath, sink, filter);
+ else
+ readFile(srcPath, sink);
+ });
+ return addToStoreFromDump(*source, name, method, hashAlgo, repair);
+}
+
+
/*
The aim of this function is to compute in one pass the correct ValidPathInfo for
the files that we are trying to add to the store. To accomplish that in one