diff mbox series

tinfoil: Only allow one process progress bar at once (continued)

Message ID 20260324230608.3291465-1-pkj@axis.com
State New
Headers show
Series tinfoil: Only allow one process progress bar at once (continued) | expand

Commit Message

Peter Kjellerstedt March 24, 2026, 11:06 p.m. UTC
In commit fcf6effe8c6de015e0ec65f908b606af6d096c23, the handling of
process progress bars was changed so that only one can be active at
once. However, for tinfoil it was only half done as apparently virtually
the same code exists in two places and only the first was updated. This
corrects the second occurence.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---
 lib/bb/tinfoil.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/lib/bb/tinfoil.py b/lib/bb/tinfoil.py
index 9c1768942..634d7796f 100644
--- a/lib/bb/tinfoil.py
+++ b/lib/bb/tinfoil.py
@@ -927,23 +927,23 @@  class Tinfoil:
                             if isinstance(event, bb.event.ProcessStarted):
                                 if self.quiet > 1:
                                     continue
+                                if parseprogress:
+                                    parseprogress.finish()
                                 parseprogress = bb.ui.knotty.new_progress(event.processname, event.total)
                                 parseprogress.start(False)
                                 continue
                             if isinstance(event, bb.event.ProcessProgress):
                                 if self.quiet > 1:
                                     continue
-                                if parseprogress:
+                                if parseprogress and parseprogress.id == event.processname:
                                     parseprogress.update(event.progress)
-                                else:
-                                    bb.warn("Got ProcessProgress event for something that never started?")
                                 continue
                             if isinstance(event, bb.event.ProcessFinished):
                                 if self.quiet > 1:
                                     continue
-                                if parseprogress:
+                                if parseprogress and parseprogress.id == event.processname:
                                     parseprogress.finish()
-                                parseprogress = None
+                                    parseprogress = None
                                 continue
                             if isinstance(event, bb.command.CommandCompleted):
                                 result = True