diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2010-01-21 23:49:17 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-01-21 23:49:17 +0000 |
commit | 5ebad0d500562a132067b423bb6711e8893f2859 (patch) | |
tree | 395567a09b82a0bf89331d32f927fbe77496ec79 | |
parent | 5c62833766048b83c0d7ea9e77194b9ca6af7fb1 (diff) | |
download | ast2050-yocto-poky-5ebad0d500562a132067b423bb6711e8893f2859.zip ast2050-yocto-poky-5ebad0d500562a132067b423bb6711e8893f2859.tar.gz |
knotty: Improve task failure message handling using the uihelper code
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 10 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/knotty.py | 20 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/uihelper.py | 11 |
3 files changed, 31 insertions, 10 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index 1f9907b..3a43889 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py @@ -1042,11 +1042,11 @@ class RunQueue: try: while self.stats.active > 0: bb.event.fire(runQueueExitWait(self.stats.active), self.cfgData) - bb.msg.note(1, bb.msg.domain.RunQueue, "Waiting for %s active tasks to finish" % self.stats.active) - tasknum = 1 - for k, v in self.build_pids.iteritems(): - bb.msg.note(1, bb.msg.domain.RunQueue, "%s: %s (pid %s)" % (tasknum, self.get_user_idstring(v), k)) - tasknum = tasknum + 1 + #bb.msg.note(1, bb.msg.domain.RunQueue, "Waiting for %s active tasks to finish" % self.stats.active) + #tasknum = 1 + #for k, v in self.build_pids.iteritems(): + # bb.msg.note(1, bb.msg.domain.RunQueue, "%s: %s (pid %s)" % (tasknum, self.get_user_idstring(v), k)) + # tasknum = tasknum + 1 result = os.waitpid(-1, os.WNOHANG) if result[0] is 0 and result[1] is 0: return diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py index c69fd6c..7264c79 100644 --- a/bitbake/lib/bb/ui/knotty.py +++ b/bitbake/lib/bb/ui/knotty.py @@ -23,6 +23,9 @@ import os import sys import itertools import xmlrpclib +from bb import ui +from bb.ui import uihelper + parsespin = itertools.cycle( r'|/-\\' ) @@ -32,6 +35,8 @@ def init(server, eventHandler): includelogs = server.runCommand(["getVariable", "BBINCLUDELOGS"]) loglines = server.runCommand(["getVariable", "BBINCLUDELOGS_LINES"]) + helper = uihelper.BBUIHelper() + try: cmdline = server.runCommand(["getCmdLineAction"]) #print cmdline @@ -53,6 +58,19 @@ def init(server, eventHandler): if event is None: continue #print event + helper.eventHandler(event) + if isinstance(event, bb.runqueue.runQueueExitWait): + if not shutdown: + shutdown = 1 + if shutdown and helper.needUpdate: + activetasks, failedtasks = helper.getTasks() + if activetasks: + print "Waiting for %s active tasks to finish:" % len(activetasks) + tasknum = 1 + for task in activetasks: + print "%s: %s (pid %s)" % (tasknum, activetasks[task]["title"], task) + tasknum = tasknum + 1 + if isinstance(event, bb.msg.MsgPlain): print event._message continue @@ -139,6 +157,8 @@ def init(server, eventHandler): continue if isinstance(event, bb.runqueue.runQueueEvent): continue + if isinstance(event, bb.runqueue.runQueueExitWait): + continue if isinstance(event, bb.event.StampUpdate): continue if isinstance(event, bb.event.ConfigParsed): diff --git a/bitbake/lib/bb/ui/uihelper.py b/bitbake/lib/bb/ui/uihelper.py index 151ffc5..698de03 100644 --- a/bitbake/lib/bb/ui/uihelper.py +++ b/bitbake/lib/bb/ui/uihelper.py @@ -21,18 +21,18 @@ class BBUIHelper: def __init__(self): self.needUpdate = False self.running_tasks = {} - self.failed_tasks = {} + self.failed_tasks = [] def eventHandler(self, event): if isinstance(event, bb.build.TaskStarted): - self.running_tasks["%s %s\n" % (event._package, event._task)] = "" + self.running_tasks[event.pid] = { 'title' : "%s %s" % (event._package, event._task) } self.needUpdate = True if isinstance(event, bb.build.TaskSucceeded): - del self.running_tasks["%s %s\n" % (event._package, event._task)] + del self.running_tasks[event.pid] self.needUpdate = True if isinstance(event, bb.build.TaskFailed): - del self.running_tasks["%s %s\n" % (event._package, event._task)] - self.failed_tasks["%s %s\n" % (event._package, event._task)] = "" + del self.running_tasks[event.pid] + self.failed_tasks.append( { 'title' : "%s %s" % (event._package, event._task)}) self.needUpdate = True # Add runqueue event handling @@ -46,4 +46,5 @@ class BBUIHelper: # a = 1 def getTasks(self): + self.needUpdate = False return (self.running_tasks, self.failed_tasks) |