Restore activity metadata
This allows the progress bar to display "building perl-5.22.3" instead of "building /nix/store/<hash>-perl-5.22.3.drv".
This commit is contained in:
parent
1f56235438
commit
0e9ddcc306
4 changed files with 43 additions and 27 deletions
|
|
@ -93,7 +93,8 @@ public:
|
|||
update(state);
|
||||
}
|
||||
|
||||
void startActivity(ActivityId act, ActivityType type, const std::string & s) override
|
||||
void startActivity(ActivityId act, ActivityType type, const std::string & s,
|
||||
const Fields & fields) override
|
||||
{
|
||||
auto state(state_.lock());
|
||||
|
||||
|
|
@ -102,6 +103,13 @@ public:
|
|||
state->its.emplace(act, i);
|
||||
state->activitiesByType[type].its.emplace(act, i);
|
||||
|
||||
if (type == actBuild) {
|
||||
auto name = storePathToName(getS(fields, 0));
|
||||
if (hasSuffix(name, ".drv"))
|
||||
name.resize(name.size() - 4);
|
||||
i->s = fmt("building " ANSI_BOLD "%s" ANSI_NORMAL, name);
|
||||
}
|
||||
|
||||
update(*state);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue