diff options
author | Shane Wang <shane.wang@intel.com> | 2012-02-23 21:47:16 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-02-23 22:52:17 +0000 |
commit | 8fa33800efa530c765d85a520110285467ff29c2 (patch) | |
tree | 62cdc94429ed5772df63d0f200fdc49ccf0528a0 /bitbake/lib/bb/cooker.py | |
parent | de77b9752ab2df56d87dc15ed5cd0d2cd5544dc7 (diff) | |
download | poky-8fa33800efa530c765d85a520110285467ff29c2.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
(Bitbake rev: 9ede881620c501574f014e600cea6947ea908ac2)
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 'bitbake/lib/bb/cooker.py')
-rw-r--r-- | bitbake/lib/bb/cooker.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 91fdc96b8a..d645454c7c 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -334,6 +334,7 @@ class BBCooker: | |||
334 | """ | 334 | """ |
335 | Prepare a runqueue and taskdata object for iteration over pkgs_to_build | 335 | Prepare a runqueue and taskdata object for iteration over pkgs_to_build |
336 | """ | 336 | """ |
337 | bb.event.fire(bb.event.TreeDataPreparationStarted(), self.configuration.data) | ||
337 | # Need files parsed | 338 | # Need files parsed |
338 | self.updateCache() | 339 | self.updateCache() |
339 | # If we are told to do the None task then query the default task | 340 | # If we are told to do the None task then query the default task |
@@ -350,11 +351,14 @@ class BBCooker: | |||
350 | taskdata = bb.taskdata.TaskData(False, skiplist=self.skiplist) | 351 | taskdata = bb.taskdata.TaskData(False, skiplist=self.skiplist) |
351 | 352 | ||
352 | runlist = [] | 353 | runlist = [] |
354 | current = 0 | ||
353 | for k in pkgs_to_build: | 355 | for k in pkgs_to_build: |
354 | taskdata.add_provider(localdata, self.status, k) | 356 | taskdata.add_provider(localdata, self.status, k) |
355 | runlist.append([k, "do_%s" % task]) | 357 | runlist.append([k, "do_%s" % task]) |
358 | current += 1 | ||
359 | bb.event.fire(bb.event.TreeDataPreparationProgress(current, len(pkgs_to_build)), self.configuration.data) | ||
356 | taskdata.add_unresolved(localdata, self.status) | 360 | taskdata.add_unresolved(localdata, self.status) |
357 | 361 | bb.event.fire(bb.event.TreeDataPreparationCompleted(len(pkgs_to_build)), self.configuration.data) | |
358 | return runlist, taskdata | 362 | return runlist, taskdata |
359 | 363 | ||
360 | def generateTaskDepTreeData(self, pkgs_to_build, task): | 364 | def generateTaskDepTreeData(self, pkgs_to_build, task): |
@@ -1100,7 +1104,7 @@ class BBCooker: | |||
1100 | return False | 1104 | return False |
1101 | 1105 | ||
1102 | if not retval: | 1106 | if not retval: |
1103 | bb.event.fire(bb.event.BuildCompleted(buildname, item, failures), self.configuration.event_data) | 1107 | bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runq_fnid), buildname, item, failures), self.configuration.event_data) |
1104 | self.command.finishAsyncCommand() | 1108 | self.command.finishAsyncCommand() |
1105 | return False | 1109 | return False |
1106 | if retval is True: | 1110 | if retval is True: |
@@ -1140,7 +1144,7 @@ class BBCooker: | |||
1140 | return False | 1144 | return False |
1141 | 1145 | ||
1142 | if not retval: | 1146 | if not retval: |
1143 | bb.event.fire(bb.event.BuildCompleted(buildname, targets, failures), self.configuration.data) | 1147 | bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runq_fnid), buildname, targets, failures), self.configuration.data) |
1144 | self.command.finishAsyncCommand() | 1148 | self.command.finishAsyncCommand() |
1145 | return False | 1149 | return False |
1146 | if retval is True: | 1150 | if retval is True: |
@@ -1663,7 +1667,7 @@ class CookerParser(object): | |||
1663 | if parsed: | 1667 | if parsed: |
1664 | self.parsed += 1 | 1668 | self.parsed += 1 |
1665 | if self.parsed % self.progress_chunk == 0: | 1669 | if self.parsed % self.progress_chunk == 0: |
1666 | bb.event.fire(bb.event.ParseProgress(self.parsed), | 1670 | bb.event.fire(bb.event.ParseProgress(self.parsed, self.toparse), |
1667 | self.cfgdata) | 1671 | self.cfgdata) |
1668 | else: | 1672 | else: |
1669 | self.cached += 1 | 1673 | self.cached += 1 |