summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/taskdata.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-01-23 00:52:21 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-22 12:45:44 +0000
commit76a281c870621f5b5608d098a70504c6069ccd11 (patch)
tree424154ecbd9cff7be886487d5c5c23bc16259a87 /bitbake/lib/bb/taskdata.py
parent11a1f496304b5273a13dac0acb27815ecfcb8714 (diff)
downloadpoky-76a281c870621f5b5608d098a70504c6069ccd11.tar.gz
bitbake: taskdata: add the ability to access world targets list
In certain circumstances it can be useful to get access to the world targets list from a recipe in order to add dependencies on some or all of the items in it. If a special function, 'calculate_extra_depends' is defined in the recipe, and the recipe is to be built, then call it at the right point before we calculate which tasks should be run. The function can append items to the "deps" list in order to add dependencies. This is not as tidy a solution as I would have liked, but it does at least do the job. As part of this change, the buildWorldTargets function was moved to bb.providers to make it possible to call from taskdata. Part of the implementation of [YOCTO #8600]. (Bitbake rev: aba0dce57c889495ec5c13919991a060aeff65d2) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/taskdata.py')
-rw-r--r--bitbake/lib/bb/taskdata.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/bitbake/lib/bb/taskdata.py b/bitbake/lib/bb/taskdata.py
index 39c899ebb7..6e4d149e5a 100644
--- a/bitbake/lib/bb/taskdata.py
+++ b/bitbake/lib/bb/taskdata.py
@@ -172,6 +172,8 @@ class TaskData:
172 if fnid in self.tasks_fnid: 172 if fnid in self.tasks_fnid:
173 return 173 return
174 174
175 self.add_extra_deps(fn, dataCache)
176
175 for task in task_deps['tasks']: 177 for task in task_deps['tasks']:
176 178
177 # Work out task dependencies 179 # Work out task dependencies
@@ -242,6 +244,21 @@ class TaskData:
242 self.fail_fnid(fnid) 244 self.fail_fnid(fnid)
243 return 245 return
244 246
247 def add_extra_deps(self, fn, dataCache):
248 func = dataCache.extradepsfunc.get(fn, None)
249 if func:
250 bb.providers.buildWorldTargetList(dataCache)
251 pn = dataCache.pkg_fn[fn]
252 params = {'deps': dataCache.deps[fn],
253 'world_target': dataCache.world_target,
254 'pkg_pn': dataCache.pkg_pn,
255 'self_pn': pn}
256 funcname = '_%s_calculate_extra_depends' % pn.replace('-', '_')
257 paramlist = ','.join(params.keys())
258 func = 'def %s(%s):\n%s\n\n%s(%s)' % (funcname, paramlist, func, funcname, paramlist)
259 bb.utils.better_exec(func, params)
260
261
245 def have_build_target(self, target): 262 def have_build_target(self, target):
246 """ 263 """
247 Have we a build target matching this name? 264 Have we a build target matching this name?