summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/bb/runqueue.py10
-rw-r--r--bitbake/lib/bb/ui/knotty.py20
-rw-r--r--bitbake/lib/bb/ui/uihelper.py11
3 files changed, 31 insertions, 10 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 1f9907b9d..3a438894b 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 c69fd6ca6..7264c7916 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 151ffc585..698de03f0 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)