nix verify: Restore the progress indicator
This commit is contained in:
parent
b4ed97e3a3
commit
c2cab20732
3 changed files with 43 additions and 14 deletions
|
|
@ -57,6 +57,8 @@ private:
|
|||
std::map<ActivityType, ActivitiesByType> activitiesByType;
|
||||
|
||||
uint64_t filesLinked = 0, bytesLinked = 0;
|
||||
|
||||
uint64_t corruptedPaths = 0, untrustedPaths = 0;
|
||||
};
|
||||
|
||||
Sync<State> state_;
|
||||
|
|
@ -179,6 +181,16 @@ public:
|
|||
update(*state);
|
||||
}
|
||||
}
|
||||
|
||||
else if (type == resUntrustedPath) {
|
||||
state->untrustedPaths++;
|
||||
update(*state);
|
||||
}
|
||||
|
||||
else if (type == resCorruptedPath) {
|
||||
state->corruptedPaths++;
|
||||
update(*state);
|
||||
}
|
||||
}
|
||||
|
||||
void update()
|
||||
|
|
@ -285,6 +297,19 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
// FIXME: don't show "done" paths in green.
|
||||
showActivity(actVerifyPaths, "%s paths verified");
|
||||
|
||||
if (state.corruptedPaths) {
|
||||
if (!res.empty()) res += ", ";
|
||||
res += fmt(ANSI_RED "%d corrupted" ANSI_NORMAL, state.corruptedPaths);
|
||||
}
|
||||
|
||||
if (state.untrustedPaths) {
|
||||
if (!res.empty()) res += ", ";
|
||||
res += fmt(ANSI_RED "%d untrusted" ANSI_NORMAL, state.untrustedPaths);
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue