From 0e9ddcc306f0900fc38472a2c8b9d9aa886b279e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 25 Aug 2017 14:53:50 +0200 Subject: Restore activity metadata This allows the progress bar to display "building perl-5.22.3" instead of "building /nix/store/-perl-5.22.3.drv". --- src/nix/progress-bar.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/nix/progress-bar.cc') diff --git a/src/nix/progress-bar.cc b/src/nix/progress-bar.cc index f0db3be60..a692250f8 100644 --- a/src/nix/progress-bar.cc +++ b/src/nix/progress-bar.cc @@ -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); } -- cgit v1.2.3