Improve progress indicator

This commit is contained in:
Eelco Dolstra 2017-05-16 16:09:57 +02:00
parent e80257f122
commit b01d62285c
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
26 changed files with 339 additions and 168 deletions

View file

@ -65,7 +65,7 @@ struct CmdVerify : StorePathsCommand
std::string untrustedLabel("untrusted");
std::string corruptedLabel("corrupted");
std::string failedLabel("failed");
logger->setExpected(doneLabel, storePaths.size());
//logger->setExpected(doneLabel, storePaths.size());
ThreadPool pool;
@ -73,7 +73,7 @@ struct CmdVerify : StorePathsCommand
try {
checkInterrupt();
Activity act(*logger, lvlInfo, format("checking %s") % storePath);
//Activity act(*logger, lvlInfo, format("checking %s") % storePath);
auto info = store->queryPathInfo(storePath);
@ -85,7 +85,7 @@ struct CmdVerify : StorePathsCommand
auto hash = sink.finish();
if (hash.first != info->narHash) {
logger->incProgress(corruptedLabel);
//logger->incProgress(corruptedLabel);
corrupted = 1;
printError(
format("path %s was modified! expected hash %s, got %s")
@ -137,19 +137,19 @@ struct CmdVerify : StorePathsCommand
}
if (!good) {
logger->incProgress(untrustedLabel);
//logger->incProgress(untrustedLabel);
untrusted++;
printError(format("path %s is untrusted") % info->path);
}
}
logger->incProgress(doneLabel);
//logger->incProgress(doneLabel);
done++;
} catch (Error & e) {
printError(format(ANSI_RED "error:" ANSI_NORMAL " %s") % e.what());
logger->incProgress(failedLabel);
//logger->incProgress(failedLabel);
failed++;
}
};