diff options
-rw-r--r-- | bitbake/lib/bb/utils.py | 12 | ||||
-rw-r--r-- | bitbake/lib/bblayers/query.py | 12 |
2 files changed, 19 insertions, 5 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index b7e2c9218b..d6afa21542 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py | |||
@@ -1457,14 +1457,20 @@ def edit_bblayers_conf(bblayers_conf, add, remove, edit_cb=None): | |||
1457 | 1457 | ||
1458 | return (notadded, notremoved) | 1458 | return (notadded, notremoved) |
1459 | 1459 | ||
1460 | 1460 | def get_collection_res(d): | |
1461 | def get_file_layer(filename, d): | ||
1462 | """Determine the collection (as defined by a layer's layer.conf file) containing the specified file""" | ||
1463 | collections = (d.getVar('BBFILE_COLLECTIONS') or '').split() | 1461 | collections = (d.getVar('BBFILE_COLLECTIONS') or '').split() |
1464 | collection_res = {} | 1462 | collection_res = {} |
1465 | for collection in collections: | 1463 | for collection in collections: |
1466 | collection_res[collection] = d.getVar('BBFILE_PATTERN_%s' % collection) or '' | 1464 | collection_res[collection] = d.getVar('BBFILE_PATTERN_%s' % collection) or '' |
1467 | 1465 | ||
1466 | return collection_res | ||
1467 | |||
1468 | |||
1469 | def get_file_layer(filename, d, collection_res={}): | ||
1470 | """Determine the collection (as defined by a layer's layer.conf file) containing the specified file""" | ||
1471 | if not collection_res: | ||
1472 | collection_res = get_collection_res(d) | ||
1473 | |||
1468 | def path_to_layer(path): | 1474 | def path_to_layer(path): |
1469 | # Use longest path so we handle nested layers | 1475 | # Use longest path so we handle nested layers |
1470 | matchlen = 0 | 1476 | matchlen = 0 |
diff --git a/bitbake/lib/bblayers/query.py b/bitbake/lib/bblayers/query.py index ee2db0efed..f5e3c84747 100644 --- a/bitbake/lib/bblayers/query.py +++ b/bitbake/lib/bblayers/query.py | |||
@@ -21,6 +21,10 @@ def plugin_init(plugins): | |||
21 | 21 | ||
22 | 22 | ||
23 | class QueryPlugin(LayerPlugin): | 23 | class QueryPlugin(LayerPlugin): |
24 | def __init__(self): | ||
25 | super(QueryPlugin, self).__init__() | ||
26 | self.collection_res = {} | ||
27 | |||
24 | def do_show_layers(self, args): | 28 | def do_show_layers(self, args): |
25 | """show current configured layers.""" | 29 | """show current configured layers.""" |
26 | logger.plain("%s %s %s" % ("layer".ljust(20), "path".ljust(40), "priority")) | 30 | logger.plain("%s %s %s" % ("layer".ljust(20), "path".ljust(40), "priority")) |
@@ -222,7 +226,6 @@ skipped recipes will also be listed, with a " (skipped)" suffix. | |||
222 | multilayer = True | 226 | multilayer = True |
223 | if prov[0] != pref[0]: | 227 | if prov[0] != pref[0]: |
224 | same_ver = False | 228 | same_ver = False |
225 | |||
226 | if (multilayer or not show_overlayed_only) and (same_ver or not show_same_ver_only): | 229 | if (multilayer or not show_overlayed_only) and (same_ver or not show_same_ver_only): |
227 | if not items_listed: | 230 | if not items_listed: |
228 | logger.plain('=== %s ===' % title) | 231 | logger.plain('=== %s ===' % title) |
@@ -243,8 +246,13 @@ skipped recipes will also be listed, with a " (skipped)" suffix. | |||
243 | else: | 246 | else: |
244 | return '?' | 247 | return '?' |
245 | 248 | ||
249 | def get_collection_res(self): | ||
250 | if not self.collection_res: | ||
251 | self.collection_res = bb.utils.get_collection_res(self.tinfoil.config_data) | ||
252 | return self.collection_res | ||
253 | |||
246 | def get_file_layerdir(self, filename): | 254 | def get_file_layerdir(self, filename): |
247 | layer = bb.utils.get_file_layer(filename, self.tinfoil.config_data) | 255 | layer = bb.utils.get_file_layer(filename, self.tinfoil.config_data, self.get_collection_res()) |
248 | return self.bbfile_collections.get(layer, None) | 256 | return self.bbfile_collections.get(layer, None) |
249 | 257 | ||
250 | def remove_layer_prefix(self, f): | 258 | def remove_layer_prefix(self, f): |