diff options
Diffstat (limited to 'src/libstore/store-api.cc')
-rw-r--r-- | src/libstore/store-api.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index 463e132e0299..b03e4080afc2 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -357,6 +357,19 @@ const Store::Stats & Store::getStats() } +void copyStorePath(ref<Store> srcStore, ref<Store> dstStore, + const Path & storePath) +{ + auto info = srcStore->queryPathInfo(storePath); + + StringSink sink; + srcStore->exportPaths({storePath}, false, sink); + + StringSource source(*sink.s); + dstStore->importPaths(false, source, 0); +} + + ValidPathInfo decodeValidPathInfo(std::istream & str, bool hashGiven) { ValidPathInfo info; |