1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 04:21:16 +02:00

Progress indicator: Cleanup

This commit is contained in:
Eelco Dolstra 2017-08-16 16:38:23 +02:00
parent dff12b38f9
commit 40bffe0a43
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
7 changed files with 105 additions and 151 deletions

View file

@ -565,7 +565,7 @@ void Store::buildPaths(const PathSet & paths, BuildMode buildMode)
void copyStorePath(ref<Store> srcStore, ref<Store> dstStore,
const Path & storePath, RepairFlag repair, CheckSigsFlag checkSigs)
{
Activity act(actCopyPath, fmt("copying path '%s'", storePath));
Activity act(*logger, actCopyPath, fmt("copying path '%s'", storePath));
auto info = srcStore->queryPathInfo(storePath);
@ -621,7 +621,7 @@ void copyPaths(ref<Store> srcStore, ref<Store> dstStore, const PathSet & storePa
for (auto & path : storePaths)
if (!valid.count(path)) missing.insert(path);
Activity act(actCopyPaths, fmt("copying %d paths", missing.size()));
Activity act(*logger, actCopyPaths, fmt("copying %d paths", missing.size()));
std::atomic<size_t> nrDone{0};
std::atomic<uint64_t> bytesExpected{0};
@ -646,7 +646,7 @@ void copyPaths(ref<Store> srcStore, ref<Store> dstStore, const PathSet & storePa
auto info = srcStore->queryPathInfo(storePath);
bytesExpected += info->narSize;
logger->event(evSetExpected, act, actCopyPath, bytesExpected);
act.setExpected(actCopyPath, bytesExpected);
return info->references;
},
@ -655,7 +655,6 @@ void copyPaths(ref<Store> srcStore, ref<Store> dstStore, const PathSet & storePa
checkInterrupt();
if (!dstStore->isValidPath(storePath)) {
printInfo("copying '%s'...", storePath);
MaintainCount<decltype(nrRunning)> mc(nrRunning);
showProgress();
copyStorePath(srcStore, dstStore, storePath, repair, checkSigs);