[bitbake-devel] [PATCH] runqueue: teach runonly/runall to accept "do_task" as well as "task"

Chris Laplante chris.laplante at agilent.com
Mon Feb 24 15:44:01 UTC 2020


Previously --runonly=do_task would give a misleading error like:

  ERROR: Could not find any tasks with the tasknames ['do_task'] to run
  within the recipes of the taskgraphs of the targets...

The problem is that BitBake tried to find "do_do_task". So teach it to
only add the do_ prefix if it's not already there.

Signed-off-by: Chris Laplante <chris.laplante at agilent.com>
---
 lib/bb/runqueue.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index 71108ee..32966b4 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -920,9 +920,11 @@ class RunQueueData:
             runq_build = {}

             for task in self.cooker.configuration.runall:
+                if not task.startswith("do_"):
+                    task = "do_{0}".format(task)
                 runall_tids = set()
                 for tid in list(self.runtaskentries):
-                    wanttid = fn_from_tid(tid) + ":do_%s" % task
+                    wanttid = "{0}:{1}".format(fn_from_tid(tid), task)
                     if wanttid in delcount:
                         self.runtaskentries[wanttid] = delcount[wanttid]
                     if wanttid in self.runtaskentries:
@@ -949,7 +951,9 @@ class RunQueueData:
             runq_build = {}

             for task in self.cooker.configuration.runonly:
-                runonly_tids = { k: v for k, v in self.runtaskentries.items() if taskname_from_tid(k) == "do_%s" % task }
+                if not task.startswith("do_"):
+                    task = "do_{0}".format(task)
+                runonly_tids = { k: v for k, v in self.runtaskentries.items() if taskname_from_tid(k) == task }

                 for tid in list(runonly_tids):
                     mark_active(tid,1)
--
2.7.4



More information about the bitbake-devel mailing list