aboutsummaryrefslogtreecommitdiff
path: root/src/libstore
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-01-21 11:33:32 +0100
committerGitHub <noreply@github.com>2022-01-21 11:33:32 +0100
commite85cf34ea3518897a3f05e53ed6c75da630b65cf (patch)
treeb1db6533e2b8426615fc01521883b1238d0d03e9 /src/libstore
parentaccfcfff6b18afe66f25303026a4c9f6cc1549d9 (diff)
parent5ee937523da63b26cc6dd264cc3cb2717321c5cd (diff)
Merge pull request #5949 from obsidiansystems/old-copyClosure
Add back `copyClosure` for plain `StorePath`s
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/store-api.cc15
-rw-r--r--src/libstore/store-api.hh7
2 files changed, 22 insertions, 0 deletions
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc
index aab4ce94c..84767e917 100644
--- a/src/libstore/store-api.cc
+++ b/src/libstore/store-api.cc
@@ -1109,6 +1109,21 @@ void copyClosure(
copyPaths(srcStore, dstStore, closure, repair, checkSigs, substitute);
}
+void copyClosure(
+ Store & srcStore,
+ Store & dstStore,
+ const StorePathSet & storePaths,
+ RepairFlag repair,
+ CheckSigsFlag checkSigs,
+ SubstituteFlag substitute)
+{
+ if (&srcStore == &dstStore) return;
+
+ StorePathSet closure;
+ srcStore.computeFSClosure(storePaths, closure);
+ copyPaths(srcStore, dstStore, closure, repair, checkSigs, substitute);
+}
+
std::optional<ValidPathInfo> decodeValidPathInfo(const Store & store, std::istream & str, std::optional<HashResult> hashGiven)
{
std::string path;
diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh
index 07f45d1e9..8306509f3 100644
--- a/src/libstore/store-api.hh
+++ b/src/libstore/store-api.hh
@@ -815,6 +815,13 @@ void copyClosure(
CheckSigsFlag checkSigs = CheckSigs,
SubstituteFlag substitute = NoSubstitute);
+void copyClosure(
+ Store & srcStore, Store & dstStore,
+ const StorePathSet & paths,
+ RepairFlag repair = NoRepair,
+ CheckSigsFlag checkSigs = CheckSigs,
+ SubstituteFlag substitute = NoSubstitute);
+
/* Remove the temporary roots file for this process. Any temporary
root becomes garbage after this point unless it has been registered
as a (permanent) root. */