[really sent that originally out without a to/cc]

probably incomplete in respect to killing completion tags for 2nd++ targets
but should be pretty helpful as an intermediate in the quest of bringing this 
to live.

-------- Original-Nachricht --------
Betreff:        Re: [Bitbake-dev] [PATCH] Add support for comma separated tasks 
with the -c option.
Datum:  Wed, 20 Oct 2010 18:08:11 +0200
Von:    Alexander Stohr <[email protected]>



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
--
GMX DSL Doppel-Flat ab 19,99&euro;/mtl.! Jetzt auch mit
gratis Notebook-Flat! http://portal.gmx.net/de/go/dsl


diff -Nru bitbake-1.8.12.orig/lib/bb/cooker.py bitbake-1.8.12/lib/bb/cooker.py
--- bitbake-1.8.12.orig/lib/bb/cooker.py	2008-12-14 20:37:23.000000000 +0100
+++ bitbake-1.8.12/lib/bb/cooker.py	2010-10-20 17:58:54.000000000 +0200
@@ -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.")

diff -Nru bitbake-1.8.18.orig/lib/bb/cooker.py bitbake-1.8.18/lib/bb/cooker.py
--- bitbake-1.8.18.orig/lib/bb/cooker.py	2009-11-10 16:22:07.000000000 +0100
+++ bitbake-1.8.18/lib/bb/cooker.py	2010-10-20 17:46:27.000000000 +0200
@@ -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.")

diff -Nru bitbake-1.10.0.orig/lib/bb/cooker.py bitbake-1.10.0/lib/bb/cooker.py
--- bitbake-1.10.0.orig/lib/bb/cooker.py	2010-08-13 17:57:38.000000000 +0200
+++ bitbake-1.10.0/lib/bb/cooker.py	2010-10-20 13:14:28.000000000 +0200
@@ -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)

diff -Nru bitbake-1.10.1.orig/lib/bb/cooker.py bitbake-1.10.1/lib/bb/cooker.py
--- bitbake-1.10.1.orig/lib/bb/cooker.py	2010-10-15 02:45:07.000000000 +0200
+++ bitbake-1.10.1/lib/bb/cooker.py	2010-10-20 13:07:34.000000000 +0200
@@ -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)

_______________________________________________
Bitbake-dev mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/bitbake-dev

Reply via email to