@@ -91,23 +91,23 @@ def wait_for(f):
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
@@ -39,6 +39,7 @@ interactive = sys.stdout.isatty()
class BBProgress(progressbar.ProgressBar):
def __init__(self, msg, maxval, widgets=None, extrapos=-1, resize_handler=None):
+ self.id = msg
self.msg = msg
self.extrapos = extrapos
if not widgets:
@@ -84,6 +85,7 @@ class NonInteractiveProgress(object):
fobj = sys.stdout
def __init__(self, msg, maxval):
+ self.id = msg
self.msg = msg
self.maxval = maxval
self.finished = False
@@ -886,23 +888,23 @@ def main(server, eventHandler, params, tf = TerminalFilter):
if params.options.quiet > 1:
continue
termfilter.clearFooter()
+ if parseprogress:
+ parseprogress.finish()
parseprogress = new_progress(event.processname, event.total)
parseprogress.start(False)
continue
if isinstance(event, bb.event.ProcessProgress):
if params.options.quiet > 1:
continue
- if parseprogress:
+ if parseprogress and parseprogress.id == event.processname:
parseprogress.update(event.progress)
- else:
- bb.warn("Got ProcessProgress event for someting that never started?")
continue
if isinstance(event, bb.event.ProcessFinished):
if params.options.quiet > 1:
continue
- if parseprogress:
+ if parseprogress and parseprogress.id == event.processname:
parseprogress.finish()
- parseprogress = None
+ parseprogress = None
continue
# ignore
@@ -200,6 +200,7 @@ def main(server, eventHandler, params):
logger.error("XMLRPC Fault getting commandline: {0}".format(x))
return 1
+ active_process = None
active_process_total = None
is_tasks_running = False
@@ -300,16 +301,23 @@ def main(server, eventHandler, params):
if isinstance(event, bb.event.ProcessStarted):
if event.processname in ["Initialising tasks", "Checking sstate mirror object availability"]:
+ if active_process:
+ ui.progress(active_process, 100)
+ ui.block_end()
+ active_process = event.processname
active_process_total = event.total
ui.block_start(event.processname)
if isinstance(event, bb.event.ProcessFinished):
if event.processname in ["Initialising tasks", "Checking sstate mirror object availability"]:
- ui.progress(event.processname, 100)
- ui.block_end()
+ if active_process and active_process == event.processname:
+ ui.progress(event.processname, 100)
+ ui.block_end()
+ active_process = None
if isinstance(event, bb.event.ProcessProgress):
if event.processname in ["Initialising tasks",
"Checking sstate mirror object availability"] and active_process_total != 0:
- ui.progress(event.processname, event.progress * 100 / active_process_total)
+ if active_process and active_process == event.processname:
+ ui.progress(event.processname, event.progress * 100 / active_process_total)
if isinstance(event, bb.event.CacheLoadStarted):
ui.block_start("Loading cache")
if isinstance(event, bb.event.CacheLoadProgress):
In case a process progress bar (e.g., "Initialising tasks") is active when a new one (e.g., "Checking sstate mirror object availability") is started, then finish the first one before starting the second. Also ignore ProcessProgress and ProcessFinished events that are not for the currently active progress bar. This also adds an id to BBProgress (initialized to the initial msg), which is not affected by calls to setmessage(). Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> --- bitbake/lib/bb/tinfoil.py | 10 +++++----- bitbake/lib/bb/ui/knotty.py | 12 +++++++----- bitbake/lib/bb/ui/teamcity.py | 14 +++++++++++--- 3 files changed, 23 insertions(+), 13 deletions(-)