diff options
Diffstat (limited to 'bitbake/lib/bblayers/query.py')
-rw-r--r-- | bitbake/lib/bblayers/query.py | 50 |
1 files changed, 32 insertions, 18 deletions
diff --git a/bitbake/lib/bblayers/query.py b/bitbake/lib/bblayers/query.py index 525d4f0d47..bfc18a7593 100644 --- a/bitbake/lib/bblayers/query.py +++ b/bitbake/lib/bblayers/query.py @@ -1,4 +1,6 @@ # +# Copyright BitBake Contributors +# # SPDX-License-Identifier: GPL-2.0-only # @@ -27,12 +29,12 @@ class QueryPlugin(LayerPlugin): def do_show_layers(self, args): """show current configured layers.""" - logger.plain("%s %s %s" % ("layer".ljust(20), "path".ljust(40), "priority")) - logger.plain('=' * 74) + logger.plain("%s %s %s" % ("layer".ljust(20), "path".ljust(70), "priority")) + logger.plain('=' * 104) for layer, _, regex, pri in self.tinfoil.cooker.bbfile_config_priorities: layerdir = self.bbfile_collections.get(layer, None) - layername = self.get_layer_name(layerdir) - logger.plain("%s %s %d" % (layername.ljust(20), layerdir.ljust(40), pri)) + layername = layer + logger.plain("%s %s %s" % (layername.ljust(20), layerdir.ljust(70), pri)) def version_str(self, pe, pv, pr = None): verstr = "%s" % pv @@ -55,11 +57,12 @@ are overlayed will also be listed, with a " (skipped)" suffix. # Check for overlayed .bbclass files classes = collections.defaultdict(list) for layerdir in self.bblayers: - classdir = os.path.join(layerdir, 'classes') - if os.path.exists(classdir): - for classfile in os.listdir(classdir): - if os.path.splitext(classfile)[1] == '.bbclass': - classes[classfile].append(classdir) + for c in ["classes-global", "classes-recipe", "classes"]: + classdir = os.path.join(layerdir, c) + if os.path.exists(classdir): + for classfile in os.listdir(classdir): + if os.path.splitext(classfile)[1] == '.bbclass': + classes[classfile].append(classdir) # Locating classes and other files is a bit more complicated than recipes - # layer priority is not a factor; instead BitBake uses the first matching @@ -122,9 +125,14 @@ skipped recipes will also be listed, with a " (skipped)" suffix. if inherits: bbpath = str(self.tinfoil.config_data.getVar('BBPATH')) for classname in inherits: - classfile = 'classes/%s.bbclass' % classname - if not bb.utils.which(bbpath, classfile, history=False): - logger.error('No class named %s found in BBPATH', classfile) + found = False + for c in ["classes-global", "classes-recipe", "classes"]: + cfile = c + '/%s.bbclass' % classname + if bb.utils.which(bbpath, cfile, history=False): + found = True + break + if not found: + logger.error('No class named %s found in BBPATH', classname) sys.exit(1) pkg_pn = self.tinfoil.cooker.recipecaches[mc].pkg_pn @@ -172,7 +180,7 @@ skipped recipes will also be listed, with a " (skipped)" suffix. logger.plain(" %s %s%s", layer.ljust(20), ver, skipped) global_inherit = (self.tinfoil.config_data.getVar('INHERIT') or "").split() - cls_re = re.compile('classes/') + cls_re = re.compile('classes.*/') preffiles = [] show_unique_pn = [] @@ -274,7 +282,10 @@ Lists recipes with the bbappends that apply to them as subitems. else: logger.plain('=== Appended recipes ===') - pnlist = list(self.tinfoil.cooker_data.pkg_pn.keys()) + + cooker_data = self.tinfoil.cooker.recipecaches[args.mc] + + pnlist = list(cooker_data.pkg_pn.keys()) pnlist.sort() appends = False for pn in pnlist: @@ -287,7 +298,7 @@ Lists recipes with the bbappends that apply to them as subitems. if not found: continue - if self.show_appends_for_pn(pn): + if self.show_appends_for_pn(pn, cooker_data, args.mc): appends = True if not args.pnspec and self.show_appends_for_skipped(): @@ -296,8 +307,10 @@ Lists recipes with the bbappends that apply to them as subitems. if not appends: logger.plain('No append files found') - def show_appends_for_pn(self, pn): - filenames = self.tinfoil.cooker_data.pkg_pn[pn] + def show_appends_for_pn(self, pn, cooker_data, mc): + filenames = cooker_data.pkg_pn[pn] + if mc: + pn = "mc:%s:%s" % (mc, pn) best = self.tinfoil.find_best_provider(pn) best_filename = os.path.basename(best[3]) @@ -405,7 +418,7 @@ NOTE: .bbappend files can impact the dependencies. self.check_cross_depends("RRECOMMENDS", layername, f, best, args.filenames, ignore_layers) # The inherit class - cls_re = re.compile('classes/') + cls_re = re.compile('classes.*/') if f in self.tinfoil.cooker_data.inherits: inherits = self.tinfoil.cooker_data.inherits[f] for cls in inherits: @@ -522,6 +535,7 @@ NOTE: .bbappend files can impact the dependencies. parser_show_appends = self.add_command(sp, 'show-appends', self.do_show_appends) parser_show_appends.add_argument('pnspec', nargs='*', help='optional recipe name specification (wildcards allowed, enclose in quotes to avoid shell expansion)') + parser_show_appends.add_argument('--mc', help='use specified multiconfig', default='') parser_show_cross_depends = self.add_command(sp, 'show-cross-depends', self.do_show_cross_depends) parser_show_cross_depends.add_argument('-f', '--filenames', help='show full file path', action='store_true') |