about summary refs log tree commit diff
path: root/src/nix/progress-bar.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-08-25T12·53+0200
committerEelco Dolstra <edolstra@gmail.com>2017-08-25T13·58+0200
commit0e9ddcc306f0900fc38472a2c8b9d9aa886b279e (patch)
tree564883e41ee9aee98ec1bdceed43f7d2be8f905b /src/nix/progress-bar.cc
parent1f56235438984d8079159d7c81ad4127c318b2dc (diff)
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".
Diffstat (limited to 'src/nix/progress-bar.cc')
-rw-r--r--src/nix/progress-bar.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/nix/progress-bar.cc b/src/nix/progress-bar.cc
index f0db3be60263..a692250f826d 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);
     }