Add support for comma separated tasks with the -c option.
[forgot the cc]
-------- Original-Nachricht --------
Datum: Wed, 20 Oct 2010 18:08:11 +0200
Von: "Alexander Stohr" <[email protected]>
An:
Betreff: Re: [Bitbake-dev] [PATCH] Add support for comma separated tasks with the -c option.
as it is GPL...
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation.
i felt free to port that patch back to a smaller set of older versions.
it should apply as a patch to what its names says, the rest is again GPL:
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details.
regards, Alex.
PS: for the CC'ed one, thats the url for the original patch including a good reasoning along with a short description on how its operation is meant
https://lists.berlios.de/pipermail/bitbake-dev/2010-October/000719.html
Signature · 6 lines
GMX DSL Doppel-Flat ab 19,99 €/mtl.! Jetzt auch mit gratis Notebook-Flat! http://portal.gmx.net/de/go/dsl -- Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief! Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail
lib/bb/cooker.py +21 -11
@@ -70,6 +70,7 @@ if not self.configuration.cmd: self.configuration.cmd = bb.data.getVar("BB_DEFAULT_TASK", self.configuration.data) or "build" + self.configuration.cmd = self.configuration.cmd.split(",") bbpkgs = bb.data.getVar('BBPKGS', self.configuration.data, True) if bbpkgs:
@@ -228,7 +229,7 @@ if data.getVarFlag( e, 'python', envdata ): sys.__stdout__.write("\npython %s () {\n%s}\n" % (e, data.getVar(e, envdata, 1))) - def generateDotGraph( self, pkgs_to_build, ignore_deps ): + def generateDotGraph( self, pkgs_to_build, ignore_deps, task ): """ Generate a task dependency graph.
@@ -249,7 +250,8 @@ try: for k in pkgs_to_build: taskdata.add_provider(localdata, self.status, k) - runlist.append([k, "do_%s" % self.configuration.cmd]) + for t in task: + runlist.append([k, "do_%s" % t]) taskdata.add_unresolved(localdata, self.status) except bb.providers.NoProvider: sys.exit(1)
@@ -465,7 +467,7 @@ return False return matches[0] - def buildFile(self, buildfile): + def buildFile(self, buildfile, task): """ Build the file matching regexp buildfile """
@@ -475,6 +477,10 @@ if not fn: return False + # If we are told to do the None task then query the default task + if (task == None): + task = self.configuration.cmd + # Load data into the cache for fn self.bb_cache = bb.cache.init(self) self.bb_cache.loadData(fn, self.configuration.data)
@@ -496,8 +502,9 @@ # Remove stamp for target if force mode active if self.configuration.force: - bb.msg.note(2, bb.msg.domain.RunQueue, "Remove stamp %s, %s" % (self.configuration.cmd, fn)) - bb.build.del_stamp('do_%s' % self.configuration.cmd, self.configuration.data) + for t in task: + bb.msg.note(2, bb.msg.domain.RunQueue, "Remove stamp %s, %s" % (t, fn)) + bb.build.del_stamp('do_%s' % t, self.configuration.data) # Setup taskdata structure taskdata = bb.taskdata.TaskData(self.configuration.abort, self.configuration.tryaltconfigs)
@@ -507,7 +514,9 @@ bb.event.fire(bb.event.BuildStarted(buildname, [item], self.configuration.event_data)) # Execute the runqueue - runlist = [[item, "do_%s" % self.configuration.cmd]] + runlist = [] + for t in task: + runlist.append([item, "do_%s" % t]) rq = bb.runqueue.RunQueue(self, self.configuration.data, self.status, taskdata, runlist) rq.prepare_runqueue() try:
@@ -522,7 +531,7 @@ bb.event.fire(bb.event.BuildCompleted(buildname, [item], self.configuration.event_data, failures)) return True - def buildTargets(self, targets): + def buildTargets(self, targets, task): """ Attempt to build the targets specified """
@@ -540,7 +549,8 @@ try: for k in targets: taskdata.add_provider(localdata, self.status, k) - runlist.append([k, "do_%s" % self.configuration.cmd]) + for t in task: + runlist.append([k, "do_%s" % t]) taskdata.add_unresolved(localdata, self.status) except bb.providers.NoProvider: sys.exit(1)
@@ -609,7 +619,7 @@ self.interactiveMode() if self.configuration.buildfile is not None: - if not self.buildFile(self.configuration.buildfile): + if not self.buildFile(self.configuration.buildfile, self.configuration.cmd): sys.exit(1) sys.exit(0)
@@ -638,10 +648,10 @@ pkgs_to_build.append(t) if self.configuration.dot_graph: - self.generateDotGraph( pkgs_to_build, self.configuration.ignored_dot_deps ) + self.generateDotGraph( pkgs_to_build, self.configuration.ignored_dot_deps, self.configuration.cmd ) sys.exit( 0 ) - return self.buildTargets(pkgs_to_build) + return self.buildTargets(pkgs_to_build, self.configuration.cmd) except KeyboardInterrupt: bb.msg.note(1, bb.msg.domain.Collection, "KeyboardInterrupt - Build not completed.")
lib/bb/cooker.py +21 -11
@@ -69,6 +69,7 @@ if not self.configuration.cmd: self.configuration.cmd = bb.data.getVar("BB_DEFAULT_TASK", self.configuration.data) or "build" + self.configuration.cmd = self.configuration.cmd.split(",") bbpkgs = bb.data.getVar('BBPKGS', self.configuration.data, True) if bbpkgs and len(self.configuration.pkgs_to_build) == 0:
@@ -227,7 +228,7 @@ if data.getVarFlag( e, 'python', envdata ): sys.__stdout__.write("\npython %s () {\n%s}\n" % (e, data.getVar(e, envdata, 1))) - def generateDotGraph( self, pkgs_to_build, ignore_deps ): + def generateDotGraph( self, pkgs_to_build, ignore_deps, task ): """ Generate a task dependency graph.
@@ -248,7 +249,8 @@ try: for k in pkgs_to_build: taskdata.add_provider(localdata, self.status, k) - runlist.append([k, "do_%s" % self.configuration.cmd]) + for t in task: + runlist.append([k, "do_%s" % t]) taskdata.add_unresolved(localdata, self.status) except bb.providers.NoProvider: sys.exit(1)
@@ -464,7 +466,7 @@ return False return matches[0] - def buildFile(self, buildfile): + def buildFile(self, buildfile, task): """ Build the file matching regexp buildfile """
@@ -474,6 +476,10 @@ if not fn: return False + # If we are told to do the None task then query the default task + if (task == None): + task = self.configuration.cmd + # Load data into the cache for fn and parse the loaded cache data self.bb_cache = bb.cache.init(self) self.status = bb.cache.CacheData()
@@ -492,8 +498,9 @@ # Remove stamp for target if force mode active if self.configuration.force: - bb.msg.note(2, bb.msg.domain.RunQueue, "Remove stamp %s, %s" % (self.configuration.cmd, fn)) - bb.build.del_stamp('do_%s' % self.configuration.cmd, self.configuration.data) + for t in task: + bb.msg.note(2, bb.msg.domain.RunQueue, "Remove stamp %s, %s" % (t, fn)) + bb.build.del_stamp('do_%s' % t, self.configuration.data) # Setup taskdata structure taskdata = bb.taskdata.TaskData(self.configuration.abort, self.configuration.tryaltconfigs)
@@ -503,7 +510,9 @@ bb.event.fire(bb.event.BuildStarted(buildname, [item], self.configuration.event_data)) # Execute the runqueue - runlist = [[item, "do_%s" % self.configuration.cmd]] + runlist = [] + for t in task: + runlist.append([item, "do_%s" % t]) rq = bb.runqueue.RunQueue(self, self.configuration.data, self.status, taskdata, runlist) rq.prepare_runqueue() try:
@@ -518,7 +527,7 @@ bb.event.fire(bb.event.BuildCompleted(buildname, [item], self.configuration.event_data, failures)) return True - def buildTargets(self, targets): + def buildTargets(self, targets, task): """ Attempt to build the targets specified """
@@ -536,7 +545,8 @@ try: for k in targets: taskdata.add_provider(localdata, self.status, k) - runlist.append([k, "do_%s" % self.configuration.cmd]) + for t in task: + runlist.append([k, "do_%s" % t]) taskdata.add_unresolved(localdata, self.status) except bb.providers.NoProvider: sys.exit(1)
@@ -605,7 +615,7 @@ self.interactiveMode() if self.configuration.buildfile is not None: - if not self.buildFile(self.configuration.buildfile): + if not self.buildFile(self.configuration.buildfile, self.configuration.cmd): sys.exit(1) sys.exit(0)
@@ -634,10 +644,10 @@ pkgs_to_build.append(t) if self.configuration.dot_graph: - self.generateDotGraph( pkgs_to_build, self.configuration.ignored_dot_deps ) + self.generateDotGraph( pkgs_to_build, self.configuration.ignored_dot_deps, self.configuration.cmd ) sys.exit( 0 ) - return self.buildTargets(pkgs_to_build) + return self.buildTargets(pkgs_to_build, self.configuration.cmd) except KeyboardInterrupt: bb.msg.note(1, bb.msg.domain.Collection, "KeyboardInterrupt - Build not completed.")
lib/bb/cooker.py +11 -5
@@ -91,6 +91,7 @@ if not self.configuration.cmd: self.configuration.cmd = bb.data.getVar("BB_DEFAULT_TASK", self.configuration.data, True) or "build" + self.configuration.cmd = self.configuration.cmd.split(",") bbpkgs = bb.data.getVar('BBPKGS', self.configuration.data, True) if bbpkgs and len(self.configuration.pkgs_to_build) == 0:
@@ -320,7 +321,8 @@ runlist = [] for k in pkgs_to_build: taskdata.add_provider(localdata, self.status, k) - runlist.append([k, "do_%s" % task]) + for t in task: + runlist.append([k, "do_%s" % t]) taskdata.add_unresolved(localdata, self.status) rq = bb.runqueue.RunQueue(self, self.configuration.data, self.status, taskdata, runlist)
@@ -695,8 +697,9 @@ # 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, fn)) - bb.build.del_stamp('do_%s' % task, self.status, fn) + for t in task: + bb.msg.note(2, bb.msg.domain.RunQueue, "Remove stamp %s, %s" % (t, fn)) + bb.build.del_stamp('do_%s' % t, self.status, fn) # Setup taskdata structure taskdata = bb.taskdata.TaskData(self.configuration.abort)
@@ -706,7 +709,9 @@ bb.event.fire(bb.event.BuildStarted(buildname, [item]), self.configuration.event_data) # Execute the runqueue - runlist = [[item, "do_%s" % task]] + runlist = [] + for t in task: + runlist.append([item, "do_%s" % t]) rq = bb.runqueue.RunQueue(self, self.configuration.data, self.status, taskdata, runlist)
@@ -780,7 +785,8 @@ runlist = [] for k in targets: taskdata.add_provider(localdata, self.status, k) - runlist.append([k, "do_%s" % task]) + for t in task: + runlist.append([k, "do_%s" % t]) taskdata.add_unresolved(localdata, self.status) rq = bb.runqueue.RunQueue(self, self.configuration.data, self.status, taskdata, runlist)
lib/bb/cooker.py +11 -5
@@ -91,6 +91,7 @@ if not self.configuration.cmd: self.configuration.cmd = bb.data.getVar("BB_DEFAULT_TASK", self.configuration.data, True) or "build" + self.configuration.cmd = self.configuration.cmd.split(",") bbpkgs = bb.data.getVar('BBPKGS', self.configuration.data, True) if bbpkgs and len(self.configuration.pkgs_to_build) == 0:
@@ -320,7 +321,8 @@ runlist = [] for k in pkgs_to_build: taskdata.add_provider(localdata, self.status, k) - runlist.append([k, "do_%s" % task]) + for t in task: + runlist.append([k, "do_%s" % t]) taskdata.add_unresolved(localdata, self.status) rq = bb.runqueue.RunQueue(self, self.configuration.data, self.status, taskdata, runlist)
@@ -695,8 +697,9 @@ # 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, fn)) - bb.build.del_stamp('do_%s' % task, self.status, fn) + for t in task: + bb.msg.note(2, bb.msg.domain.RunQueue, "Remove stamp %s, %s" % (t, fn)) + bb.build.del_stamp('do_%s' % t, self.status, fn) # Setup taskdata structure taskdata = bb.taskdata.TaskData(self.configuration.abort)
@@ -706,7 +709,9 @@ bb.event.fire(bb.event.BuildStarted(buildname, [item]), self.configuration.event_data) # Execute the runqueue - runlist = [[item, "do_%s" % task]] + runlist = [] + for t in task: + runlist.append([item, "do_%s" % t]) rq = bb.runqueue.RunQueue(self, self.configuration.data, self.status, taskdata, runlist)
@@ -780,7 +785,8 @@ runlist = [] for k in targets: taskdata.add_provider(localdata, self.status, k) - runlist.append([k, "do_%s" % task]) + for t in task: + runlist.append([k, "do_%s" % t]) taskdata.add_unresolved(localdata, self.status) rq = bb.runqueue.RunQueue(self, self.configuration.data, self.status, taskdata, runlist)