diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2008-02-26 17:32:00 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2008-02-26 17:32:00 +0000 |
commit | 68631d637275502e8303ccef5a1046753bd0d4dc (patch) | |
tree | 0061880cc9981c4f656d2640906aea893d9990f3 | |
parent | e608db7e231d300c99790f07e49b8951e1e3c0fa (diff) | |
download | bitbake-contrib-68631d637275502e8303ccef5a1046753bd0d4dc.tar.gz |
Convert -b option to use taskdata/runqueue
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | lib/bb/cooker.py | 46 |
2 files changed, 40 insertions, 7 deletions
@@ -107,6 +107,7 @@ Changes in Bitbake 1.9.x: - Convert build.py exec_task to use getVarFlags - Update shell to use cooker.buildFile - Add StampUpdate event + - Convert -b option to use taskdata/runqueue Changes in Bitbake 1.8.0: - Release 1.7.x as a stable series diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py index 4cd9c76c4..92ee203d3 100644 --- a/lib/bb/cooker.py +++ b/lib/bb/cooker.py @@ -617,21 +617,53 @@ class BBCooker: Build the file matching regexp buildfile """ - bf = self.matchFile(buildfile) + fn = self.matchFile(buildfile) self.buildSetVars() - bbfile_data = bb.parse.handle(bf, self.configuration.data) + bbfile_data = bb.parse.handle(fn, self.configuration.data) + + # Load data into the cache for fn + self.bb_cache = bb.cache.init(self) + self.bb_cache.loadData(fn, self.configuration.data) + + # Parse the loaded cache data + self.status = bb.cache.CacheData() + self.bb_cache.handle_data(fn, self.status) + + # Tweak some variables + item = self.bb_cache.getVar('PN', fn, True) + self.status.ignored_dependencies = Set() + self.status.bbfile_priority[fn] = 1 + + # Remove external dependencies + self.status.task_deps[fn]['depends'] = {} + self.status.deps[fn] = [] + self.status.rundeps[fn] = [] + self.status.runrecs[fn] = [] # Remove stamp for target if force mode active if self.configuration.force: - bb.msg.note(2, bb.msg.domain.RunQueue, "Remove stamp %s, %s" % (task, bf)) + bb.msg.note(2, bb.msg.domain.RunQueue, "Remove stamp %s, %s" % (task, fn)) bb.build.del_stamp('do_%s' % task, bbfile_data) - item = bb.data.getVar('PN', bbfile_data, 1) + # Setup taskdata structure + taskdata = bb.taskdata.TaskData(self.configuration.abort) + taskdata.add_provider(self.configuration.data, self.status, item) + + buildname = bb.data.getVar("BUILDNAME", self.configuration.data) + bb.event.fire(bb.event.BuildStarted(buildname, [item], self.configuration.event_data)) + + # Execute the runqueue + runlist = [[item, "do_%s" % self.configuration.cmd]] + rq = bb.runqueue.RunQueue(self, self.configuration.data, self.status, taskdata, runlist) + rq.prepare_runqueue() try: - self.tryBuildPackage(bf, item, task, bbfile_data, True) - except bb.build.EventException: - bb.msg.error(bb.msg.domain.Build, "Build of '%s' failed" % item ) + failures = rq.execute_runqueue() + except runqueue.TaskFailure, fnids: + for fnid in fnids: + bb.msg.error(bb.msg.domain.Build, "'%s' failed" % taskdata.fn_index[fnid]) + return False + bb.event.fire(bb.event.BuildCompleted(buildname, [item], self.configuration.event_data, failures)) bb.event.fire(bb.command.CookerCommandCompleted(self.configuration.event_data)) def buildTargets(self, targets): |