about summary refs log tree commit diff
path: root/src/nix/progress-bar.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix/progress-bar.cc')
-rw-r--r--src/nix/progress-bar.cc27
1 files changed, 12 insertions, 15 deletions
diff --git a/src/nix/progress-bar.cc b/src/nix/progress-bar.cc
index 054127f6277e..70dbfd4e5964 100644
--- a/src/nix/progress-bar.cc
+++ b/src/nix/progress-bar.cc
@@ -192,21 +192,6 @@ public:
         update(*state);
     }
 
-    void setExpected(ActivityId act, ActivityType type, uint64_t expected) override
-    {
-        auto state(state_.lock());
-
-        auto i = state->its.find(act);
-        assert(i != state->its.end());
-        ActInfo & actInfo = *i->second;
-        auto & j = actInfo.expectedByType[type];
-        state->activitiesByType[type].expected -= j;
-        j = expected;
-        state->activitiesByType[type].expected += j;
-
-        update(*state);
-    }
-
     void result(ActivityId act, ResultType type, const std::vector<Field> & fields) override
     {
         auto state(state_.lock());
@@ -258,6 +243,18 @@ public:
             actInfo.failed = getI(fields, 3);
             update(*state);
         }
+
+        else if (type == resSetExpected) {
+            auto i = state->its.find(act);
+            assert(i != state->its.end());
+            ActInfo & actInfo = *i->second;
+            auto type = (ActivityType) getI(fields, 0);
+            auto & j = actInfo.expectedByType[type];
+            state->activitiesByType[type].expected -= j;
+            j = getI(fields, 1);
+            state->activitiesByType[type].expected += j;
+            update(*state);
+        }
     }
 
     void update()