diff options
author | Joshua Watt <JPEWhacker@gmail.com> | 2020-06-05 22:15:29 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-06-10 12:30:01 +0100 |
commit | b9fdb6a4261754459a01f9689010a38922fe0c8a (patch) | |
tree | f06ef9f8d1ad7ffa27f64e501228f4d312bdbc94 /bitbake/lib/bb/tinfoil.py | |
parent | f08d269c484417f3284c683ed690584642d33915 (diff) | |
download | poky-b9fdb6a4261754459a01f9689010a38922fe0c8a.tar.gz |
bitbake: bitbake: cooker: Split file collections per multiconfig
Splits the cooker to track a collection per multiconfig instead of a
single collection for all multiconfigs. Practically speaking, this
allows each multiconfigs to each have different BBMASKs that apply to it
instead of each one using the mask specified in the base configuration.
(Bitbake rev: dd6d8eca2027f8d9be8a734a493227b440075e49)
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/tinfoil.py')
-rw-r--r-- | bitbake/lib/bb/tinfoil.py | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/bitbake/lib/bb/tinfoil.py b/bitbake/lib/bb/tinfoil.py index 8c9b6b8ca5..dccbe0ebb5 100644 --- a/bitbake/lib/bb/tinfoil.py +++ b/bitbake/lib/bb/tinfoil.py | |||
@@ -117,15 +117,16 @@ class TinfoilCookerAdapter: | |||
117 | 117 | ||
118 | class TinfoilCookerCollectionAdapter: | 118 | class TinfoilCookerCollectionAdapter: |
119 | """ cooker.collection adapter """ | 119 | """ cooker.collection adapter """ |
120 | def __init__(self, tinfoil): | 120 | def __init__(self, tinfoil, mc=''): |
121 | self.tinfoil = tinfoil | 121 | self.tinfoil = tinfoil |
122 | self.mc = mc | ||
122 | def get_file_appends(self, fn): | 123 | def get_file_appends(self, fn): |
123 | return self.tinfoil.get_file_appends(fn) | 124 | return self.tinfoil.get_file_appends(fn, self.mc) |
124 | def __getattr__(self, name): | 125 | def __getattr__(self, name): |
125 | if name == 'overlayed': | 126 | if name == 'overlayed': |
126 | return self.tinfoil.get_overlayed_recipes() | 127 | return self.tinfoil.get_overlayed_recipes(self.mc) |
127 | elif name == 'bbappends': | 128 | elif name == 'bbappends': |
128 | return self.tinfoil.run_command('getAllAppends') | 129 | return self.tinfoil.run_command('getAllAppends', self.mc) |
129 | else: | 130 | else: |
130 | raise AttributeError("%s instance has no attribute '%s'" % (self.__class__.__name__, name)) | 131 | raise AttributeError("%s instance has no attribute '%s'" % (self.__class__.__name__, name)) |
131 | 132 | ||
@@ -185,10 +186,11 @@ class TinfoilCookerAdapter: | |||
185 | 186 | ||
186 | def __init__(self, tinfoil): | 187 | def __init__(self, tinfoil): |
187 | self.tinfoil = tinfoil | 188 | self.tinfoil = tinfoil |
188 | self.collection = self.TinfoilCookerCollectionAdapter(tinfoil) | 189 | self.multiconfigs = [''] + (tinfoil.config_data.getVar('BBMULTICONFIG') or '').split() |
190 | self.collections = {} | ||
189 | self.recipecaches = {} | 191 | self.recipecaches = {} |
190 | self.recipecaches[''] = self.TinfoilRecipeCacheAdapter(tinfoil) | 192 | for mc in self.multiconfigs: |
191 | for mc in (tinfoil.config_data.getVar('BBMULTICONFIG') or '').split(): | 193 | self.collections[mc] = self.TinfoilCookerCollectionAdapter(tinfoil, mc) |
192 | self.recipecaches[mc] = self.TinfoilRecipeCacheAdapter(tinfoil, mc) | 194 | self.recipecaches[mc] = self.TinfoilRecipeCacheAdapter(tinfoil, mc) |
193 | self._cache = {} | 195 | self._cache = {} |
194 | def __getattr__(self, name): | 196 | def __getattr__(self, name): |
@@ -492,11 +494,11 @@ class Tinfoil: | |||
492 | raise Exception('Not connected to server (did you call .prepare()?)') | 494 | raise Exception('Not connected to server (did you call .prepare()?)') |
493 | return self.server_connection.events.waitEvent(timeout) | 495 | return self.server_connection.events.waitEvent(timeout) |
494 | 496 | ||
495 | def get_overlayed_recipes(self): | 497 | def get_overlayed_recipes(self, mc=''): |
496 | """ | 498 | """ |
497 | Find recipes which are overlayed (i.e. where recipes exist in multiple layers) | 499 | Find recipes which are overlayed (i.e. where recipes exist in multiple layers) |
498 | """ | 500 | """ |
499 | return defaultdict(list, self.run_command('getOverlayedRecipes')) | 501 | return defaultdict(list, self.run_command('getOverlayedRecipes', mc)) |
500 | 502 | ||
501 | def get_skipped_recipes(self): | 503 | def get_skipped_recipes(self): |
502 | """ | 504 | """ |
@@ -534,11 +536,11 @@ class Tinfoil: | |||
534 | raise bb.providers.NoProvider('Unable to find any recipe file matching "%s"' % pn) | 536 | raise bb.providers.NoProvider('Unable to find any recipe file matching "%s"' % pn) |
535 | return best[3] | 537 | return best[3] |
536 | 538 | ||
537 | def get_file_appends(self, fn): | 539 | def get_file_appends(self, fn, mc=''): |
538 | """ | 540 | """ |
539 | Find the bbappends for a recipe file | 541 | Find the bbappends for a recipe file |
540 | """ | 542 | """ |
541 | return self.run_command('getFileAppends', fn) | 543 | return self.run_command('getFileAppends', fn, mc) |
542 | 544 | ||
543 | def all_recipes(self, mc='', sort=True): | 545 | def all_recipes(self, mc='', sort=True): |
544 | """ | 546 | """ |