diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2016-01-23 00:52:21 +1300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-01-22 12:45:44 +0000 |
commit | 76a281c870621f5b5608d098a70504c6069ccd11 (patch) | |
tree | 424154ecbd9cff7be886487d5c5c23bc16259a87 /bitbake/lib/bb/cooker.py | |
parent | 11a1f496304b5273a13dac0acb27815ecfcb8714 (diff) | |
download | poky-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/cooker.py')
-rw-r--r-- | bitbake/lib/bb/cooker.py | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 74190ec9a7..9c58d95006 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -1109,28 +1109,6 @@ class BBCooker: | |||
1109 | tree = self.generatePkgDepTreeData(pkgs, 'build') | 1109 | tree = self.generatePkgDepTreeData(pkgs, 'build') |
1110 | bb.event.fire(bb.event.TargetsTreeGenerated(tree), self.data) | 1110 | bb.event.fire(bb.event.TargetsTreeGenerated(tree), self.data) |
1111 | 1111 | ||
1112 | def buildWorldTargetList(self): | ||
1113 | """ | ||
1114 | Build package list for "bitbake world" | ||
1115 | """ | ||
1116 | parselog.debug(1, "collating packages for \"world\"") | ||
1117 | for f in self.recipecache.possible_world: | ||
1118 | terminal = True | ||
1119 | pn = self.recipecache.pkg_fn[f] | ||
1120 | |||
1121 | for p in self.recipecache.pn_provides[pn]: | ||
1122 | if p.startswith('virtual/'): | ||
1123 | parselog.debug(2, "World build skipping %s due to %s provider starting with virtual/", f, p) | ||
1124 | terminal = False | ||
1125 | break | ||
1126 | for pf in self.recipecache.providers[p]: | ||
1127 | if self.recipecache.pkg_fn[pf] != pn: | ||
1128 | parselog.debug(2, "World build skipping %s due to both us and %s providing %s", f, pf, p) | ||
1129 | terminal = False | ||
1130 | break | ||
1131 | if terminal: | ||
1132 | self.recipecache.world_target.add(pn) | ||
1133 | |||
1134 | def interactiveMode( self ): | 1112 | def interactiveMode( self ): |
1135 | """Drop off into a shell""" | 1113 | """Drop off into a shell""" |
1136 | try: | 1114 | try: |
@@ -1591,7 +1569,7 @@ class BBCooker: | |||
1591 | parselog.warn("Explicit target \"%s\" is in ASSUME_PROVIDED, ignoring" % pkg) | 1569 | parselog.warn("Explicit target \"%s\" is in ASSUME_PROVIDED, ignoring" % pkg) |
1592 | 1570 | ||
1593 | if 'world' in pkgs_to_build: | 1571 | if 'world' in pkgs_to_build: |
1594 | self.buildWorldTargetList() | 1572 | bb.providers.buildWorldTargetList(self.recipecache) |
1595 | pkgs_to_build.remove('world') | 1573 | pkgs_to_build.remove('world') |
1596 | for t in self.recipecache.world_target: | 1574 | for t in self.recipecache.world_target: |
1597 | pkgs_to_build.append(t) | 1575 | pkgs_to_build.append(t) |