summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2017-01-19 20:35:15 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-19 22:46:44 +0000
commit9289ab40e77906e983a2f79cd7602ee95be5025a (patch)
tree14744a5b6745216e607579425f11bf2b6fdfef41
parentce1e70b8018340b54dba3a81d7d379182cb77514 (diff)
downloadbitbake-contrib-9289ab40e77906e983a2f79cd7602ee95be5025a.zip
bitbake-contrib-9289ab40e77906e983a2f79cd7602ee95be5025a.tar.gz
bitbake-contrib-9289ab40e77906e983a2f79cd7602ee95be5025a.tar.bz2
build.py: add preceedtask() API
The API is required by the revised rm_work.bbclass implementation, which needs to know all tasks that do_build depends so that it can properly inject itself between do_build and those tasks. The new API primarily hides the internal implementation of the "after" and "before" dependency tracking. Because tasks defined as precondition via "recrdeptask" may or may not be relevant (they are for rm_work.bclass), the API also includes support for that. There's no default value for including recrdeptasks, so developers have to think about what they need. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/build.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/bb/build.py b/lib/bb/build.py
index 271cda6..c6104a4 100644
--- a/lib/bb/build.py
+++ b/lib/bb/build.py
@@ -862,3 +862,19 @@ def deltask(task, d):
if task in deps:
deps.remove(task)
d.setVarFlag(bbtask, 'deps', deps)
+
+def preceedtask(task, with_recrdeptasks, d):
+ """
+ Returns a set of tasks in the current recipe which were specified as
+ precondition by the task itself ("after") or which listed themselves
+ as precondition ("before"). Preceeding tasks specified via the
+ "recrdeptask" are included in the result only if requested. Beware
+ that this may lead to the task itself being listed.
+ """
+ preceed = set()
+ preceed.update(d.getVarFlag(task, 'deps') or [])
+ if with_recrdeptasks:
+ recrdeptask = d.getVarFlag(task, 'recrdeptask')
+ if recrdeptask:
+ preceed.update(recrdeptask.split())
+ return preceed