aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/runqueue.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-15 16:42:18 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-15 17:48:02 +0000
commit99ccfd411ab3f7baa111f9f3d50fae68816a9a83 (patch)
tree358aabe3a8d5fe2e7f8309a1d6b5ec16bd29a679 /lib/bb/runqueue.py
parent36cc814b64bcf3825ed096ade0b8c590e497259f (diff)
downloadbitbake-99ccfd411ab3f7baa111f9f3d50fae68816a9a83.tar.gz
runqueue: Add support for <task>- syntax
It can be useful to run all tasks up to but not including a specific task. The main reason this was never added was the lack of a good syntax. This patch uses the syntax <taskname>- to denote this behaviour which is simple, not invasive and fits what we need from good syntax IMO, hence we can add this. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/runqueue.py')
-rw-r--r--lib/bb/runqueue.py26
1 files changed, 18 insertions, 8 deletions
diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index 878028aa9..ee06f0e71 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -634,23 +634,33 @@ class RunQueueData:
fnid = taskData.build_targets[targetid][0]
fn = taskData.fn_index[fnid]
- self.target_pairs.append((fn, target[1]))
+ task = target[1]
+ parents = False
+ if task.endswith('-'):
+ parents = True
+ task = task[:-1]
+
+ self.target_pairs.append((fn, task))
if fnid in taskData.failed_fnids:
continue
- if target[1] not in taskData.tasks_lookup[fnid]:
+ if task not in taskData.tasks_lookup[fnid]:
import difflib
- close_matches = difflib.get_close_matches(target[1], taskData.tasks_lookup[fnid], cutoff=0.7)
+ close_matches = difflib.get_close_matches(task, taskData.tasks_lookup[fnid], cutoff=0.7)
if close_matches:
extra = ". Close matches:\n %s" % "\n ".join(close_matches)
else:
extra = ""
- bb.msg.fatal("RunQueue", "Task %s does not exist for target %s%s" % (target[1], target[0], extra))
-
- listid = taskData.tasks_lookup[fnid][target[1]]
-
- mark_active(listid, 1)
+ bb.msg.fatal("RunQueue", "Task %s does not exist for target %s%s" % (task, target[0], extra))
+
+ # For tasks called "XXXX-", ony run their dependencies
+ listid = taskData.tasks_lookup[fnid][task]
+ if parents:
+ for i in self.runq_depends[listid]:
+ mark_active(i, 1)
+ else:
+ mark_active(listid, 1)
# Step C - Prune all inactive tasks
#