diff options
author | Patrick Ohly <patrick.ohly@intel.com> | 2017-01-19 20:35:15 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-01-20 11:52:52 +0000 |
commit | 633697cce651ddb22c18083087531dce333c752c (patch) | |
tree | 0d72cc494ef4a0da6e4158ed2fc6b5789d213db8 /bitbake | |
parent | 3f8d56d1132cc63fe13cf81dc97ba96a523e1d44 (diff) | |
download | poky-633697cce651ddb22c18083087531dce333c752c.tar.gz |
bitbake: 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.
(Bitbake rev: 9289ab40e77906e983a2f79cd7602ee95be5025a)
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/build.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py index 271cda62c9..c6104a475e 100644 --- a/bitbake/lib/bb/build.py +++ b/bitbake/lib/bb/build.py | |||
@@ -862,3 +862,19 @@ def deltask(task, d): | |||
862 | if task in deps: | 862 | if task in deps: |
863 | deps.remove(task) | 863 | deps.remove(task) |
864 | d.setVarFlag(bbtask, 'deps', deps) | 864 | d.setVarFlag(bbtask, 'deps', deps) |
865 | |||
866 | def preceedtask(task, with_recrdeptasks, d): | ||
867 | """ | ||
868 | Returns a set of tasks in the current recipe which were specified as | ||
869 | precondition by the task itself ("after") or which listed themselves | ||
870 | as precondition ("before"). Preceeding tasks specified via the | ||
871 | "recrdeptask" are included in the result only if requested. Beware | ||
872 | that this may lead to the task itself being listed. | ||
873 | """ | ||
874 | preceed = set() | ||
875 | preceed.update(d.getVarFlag(task, 'deps') or []) | ||
876 | if with_recrdeptasks: | ||
877 | recrdeptask = d.getVarFlag(task, 'recrdeptask') | ||
878 | if recrdeptask: | ||
879 | preceed.update(recrdeptask.split()) | ||
880 | return preceed | ||