Skip to contentSkip to conversation

cooker: Add option of specifying indvidual tasks for targets

PATCH In review Richard Purdie 2 participants 3 messages Jan 27, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cooker: Add option of specifying indvidual tasks for targets

Currently its near enough impossible to tell bitbake to run target X, task Y and target A, task B. We could hack various parts of the API around but it would mean incompatibilities.

An alternative is to accept the syntax "<target>:do_<task>" as a target name. The default task would be used where the task is unspecified.

This has the advantage that its neat/clean code and works from all current APIs including the commandline.

---

bitbake/lib/bb/cooker.py +6 -1
index db4cb51..cc7d84e 100644
@@ -449,9 +449,14 @@ class BBCooker:
         current = 0
         runlist = []
         for k in fulltargetlist:
+            ktask = task
+            if ":do_" in k:
+                k2 = k.split(":do_")
+                k = k2[0]
+                ktask = k2[1]
             taskdata.add_provider(localdata, self.recipecache, k)
             current += 1
-            runlist.append([k, "do_%s" % task])
+            runlist.append([k, "do_%s" % ktask])
             bb.event.fire(bb.event.TreeDataPreparationProgress(current, len(fulltargetlist)), self.data)
         taskdata.add_unresolved(localdata, self.recipecache)
         bb.event.fire(bb.event.TreeDataPreparationCompleted(len(fulltargetlist)), self.data)
#1 lore raw
Quoted 7 lines · Richard Purdie

Currently its near enough impossible to tell bitbake to run target X, task Y and target A, task B. We could hack various parts of the API around but it would mean incompatibilities.

An alternative is to accept the syntax "<target>:do_<task>" as a target name. The default task would be used where the task is unspecified.

This should be documented in manuals as well IMO

Quoted 31 lines

This has the advantage that its neat/clean code and works from all current APIs including the commandline.

---

bitbake/lib/bb/cooker.py +6 -1
index db4cb51..cc7d84e 100644
@@ -449,9 +449,14 @@ class BBCooker:
         current = 0
         runlist = []
         for k in fulltargetlist:
+            ktask = task
+            if ":do_" in k:
+                k2 = k.split(":do_")
+                k = k2[0]
+                ktask = k2[1]
             taskdata.add_provider(localdata, self.recipecache, k)
             current += 1
-            runlist.append([k, "do_%s" % task])
+            runlist.append([k, "do_%s" % ktask])
             bb.event.fire(bb.event.TreeDataPreparationProgress(current, len(fulltargetlist)), self.data)
         taskdata.add_unresolved(localdata, self.recipecache)
         bb.event.fire(bb.event.TreeDataPreparationCompleted(len(fulltargetlist)), self.data)

_______________________________________________
bitbake-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/bitbake-devel

#2 lore raw
Quoted 11 lines · Khem Raj
Quoted 7 lines · Richard Purdie

Currently its near enough impossible to tell bitbake to run target X, task Y and target A, task B. We could hack various parts of the API around but it would mean incompatibilities.

An alternative is to accept the syntax "<target>:do_<task>" as a target name. The default task would be used where the task is unspecified.

This should be documented in manuals as well IMO

Totally agreed.

Hi Scott, we need to document this new syntax! ;-)

(I was planning to talk to Scott when I reached the point of merging this)

Cheers,

Richard

Quoted 32 lines
Quoted 31 lines

This has the advantage that its neat/clean code and works from all current APIs including the commandline.

---

bitbake/lib/bb/cooker.py +6 -1
index db4cb51..cc7d84e 100644
@@ -449,9 +449,14 @@ class BBCooker:
         current = 0
         runlist = []
         for k in fulltargetlist:
+            ktask = task
+            if ":do_" in k:
+                k2 = k.split(":do_")
+                k = k2[0]
+                ktask = k2[1]
             taskdata.add_provider(localdata, self.recipecache, k)
             current += 1
-            runlist.append([k, "do_%s" % task])
+            runlist.append([k, "do_%s" % ktask])
             bb.event.fire(bb.event.TreeDataPreparationProgress(current, len(fulltargetlist)), self.data)
         taskdata.add_unresolved(localdata, self.recipecache)
         bb.event.fire(bb.event.TreeDataPreparationCompleted(len(fulltargetlist)), self.data)

_______________________________________________
bitbake-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/bitbake-devel