1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 06:01:48 +02:00

feat: show status bar with 'store copy-sigs'

This commit is contained in:
John Rinehart 2024-03-05 15:06:01 -08:00
parent 157524874d
commit 5d534dc30f

View file

@ -41,14 +41,14 @@ struct CmdCopySigs : StorePathsCommand
ThreadPool pool; ThreadPool pool;
std::string doneLabel = "done";
std::atomic<size_t> added{0}; std::atomic<size_t> added{0};
//logger->setExpected(doneLabel, storePaths.size()); Activity act(*logger, lvlInfo, actCopyPaths, "copying signatures");
act.setExpected(actCopyPaths, storePaths.size());
std::atomic_uint64_t counter;
auto doPath = [&](const Path & storePathS) { auto doPath = [&](const Path & storePathS) {
//Activity act(*logger, lvlInfo, "getting signatures for '%s'", storePath);
checkInterrupt(); checkInterrupt();
auto storePath = store->parseStorePath(storePathS); auto storePath = store->parseStorePath(storePathS);
@ -72,15 +72,17 @@ struct CmdCopySigs : StorePathsCommand
if (!info->sigs.count(sig)) if (!info->sigs.count(sig))
newSigs.insert(sig); newSigs.insert(sig);
} catch (InvalidPath &) { } catch (InvalidPath &) {
printError("path %s was invalid in substituter %s", storePath.to_string(), store2->getUri());
} }
} }
if (!newSigs.empty()) { if (!newSigs.empty()) {
debug("adding %d signatures to store for %s", newSigs.size(), storePathS);
store->addSignatures(storePath, newSigs); store->addSignatures(storePath, newSigs);
added += newSigs.size(); added += newSigs.size();
} }
//logger->incProgress(doneLabel); act.progress(counter++);
}; };
for (auto & storePath : storePaths) for (auto & storePath : storePaths)