diff options
author | Shea Levy <shea@shealevy.com> | 2016-07-18 18:50:27 -0400 |
---|---|---|
committer | Shea Levy <shea@shealevy.com> | 2016-11-10 11:09:15 -0500 |
commit | 167d12b02cc8cadfaf7c28959532030d65687a8f (patch) | |
tree | 37907cb4370b395da98c592ae1b73070acd8ed2b /src/nix/copy.cc | |
parent | 2af5d35fdc1171a9bdab7e2fc005673d76417c06 (diff) |
build-remote: Implement in C++
Diffstat (limited to 'src/nix/copy.cc')
-rw-r--r-- | src/nix/copy.cc | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/src/nix/copy.cc b/src/nix/copy.cc index e8317dc39..976b0d3e0 100644 --- a/src/nix/copy.cc +++ b/src/nix/copy.cc @@ -46,33 +46,7 @@ struct CmdCopy : StorePathsCommand ref<Store> srcStore = srcUri.empty() ? store : openStore(srcUri); ref<Store> dstStore = dstUri.empty() ? store : openStore(dstUri); - std::string copiedLabel = "copied"; - - logger->setExpected(copiedLabel, storePaths.size()); - - ThreadPool pool; - - processGraph<Path>(pool, - PathSet(storePaths.begin(), storePaths.end()), - - [&](const Path & storePath) { - return srcStore->queryPathInfo(storePath)->references; - }, - - [&](const Path & storePath) { - checkInterrupt(); - - if (!dstStore->isValidPath(storePath)) { - Activity act(*logger, lvlInfo, format("copying ā%sā...") % storePath); - - copyStorePath(srcStore, dstStore, storePath); - - logger->incProgress(copiedLabel); - } else - logger->incExpected(copiedLabel, -1); - }); - - pool.process(); + copyPaths(srcStore, dstStore, storePaths); } }; |