summaryrefslogtreecommitdiffstats
path: root/lib/bb/cooker.py
diff options
context:
space:
mode:
authorShane Wang <shane.wang@intel.com>2012-02-23 21:47:16 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-02-23 22:51:50 +0000
commit9ede881620c501574f014e600cea6947ea908ac2 (patch)
tree0004cf85add0bef88881ddf459459260ed74ca3d /lib/bb/cooker.py
parent28501612efdfc6ee47576cc90deb6e897883e7f5 (diff)
downloadbitbake-9ede881620c501574f014e600cea6947ea908ac2.tar.gz
bitbake: change for adding progress bar in Hob2.
The changes include: - Clean some events in event.py - Fire essential events for Hob2 to handle with more information. - knotty changes Signed-off-by: Shane Wang <shane.wang@intel.com> Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/cooker.py')
-rw-r--r--lib/bb/cooker.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index 91fdc96b8..d645454c7 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -334,6 +334,7 @@ class BBCooker:
"""
Prepare a runqueue and taskdata object for iteration over pkgs_to_build
"""
+ bb.event.fire(bb.event.TreeDataPreparationStarted(), self.configuration.data)
# Need files parsed
self.updateCache()
# If we are told to do the None task then query the default task
@@ -350,11 +351,14 @@ class BBCooker:
taskdata = bb.taskdata.TaskData(False, skiplist=self.skiplist)
runlist = []
+ current = 0
for k in pkgs_to_build:
taskdata.add_provider(localdata, self.status, k)
runlist.append([k, "do_%s" % task])
+ current += 1
+ bb.event.fire(bb.event.TreeDataPreparationProgress(current, len(pkgs_to_build)), self.configuration.data)
taskdata.add_unresolved(localdata, self.status)
-
+ bb.event.fire(bb.event.TreeDataPreparationCompleted(len(pkgs_to_build)), self.configuration.data)
return runlist, taskdata
def generateTaskDepTreeData(self, pkgs_to_build, task):
@@ -1100,7 +1104,7 @@ class BBCooker:
return False
if not retval:
- bb.event.fire(bb.event.BuildCompleted(buildname, item, failures), self.configuration.event_data)
+ bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runq_fnid), buildname, item, failures), self.configuration.event_data)
self.command.finishAsyncCommand()
return False
if retval is True:
@@ -1140,7 +1144,7 @@ class BBCooker:
return False
if not retval:
- bb.event.fire(bb.event.BuildCompleted(buildname, targets, failures), self.configuration.data)
+ bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runq_fnid), buildname, targets, failures), self.configuration.data)
self.command.finishAsyncCommand()
return False
if retval is True:
@@ -1663,7 +1667,7 @@ class CookerParser(object):
if parsed:
self.parsed += 1
if self.parsed % self.progress_chunk == 0:
- bb.event.fire(bb.event.ParseProgress(self.parsed),
+ bb.event.fire(bb.event.ParseProgress(self.parsed, self.toparse),
self.cfgdata)
else:
self.cached += 1