diff options
Diffstat (limited to 'import-layers/yocto-poky/bitbake/lib/bblayers/query.py')
-rw-r--r-- | import-layers/yocto-poky/bitbake/lib/bblayers/query.py | 52 |
1 files changed, 21 insertions, 31 deletions
diff --git a/import-layers/yocto-poky/bitbake/lib/bblayers/query.py b/import-layers/yocto-poky/bitbake/lib/bblayers/query.py index ee1e7c8a1..bef3af31a 100644 --- a/import-layers/yocto-poky/bitbake/lib/bblayers/query.py +++ b/import-layers/yocto-poky/bitbake/lib/bblayers/query.py @@ -5,8 +5,6 @@ import sys import os import re -import bb.cache -import bb.providers import bb.utils from bblayers.common import LayerPlugin @@ -62,7 +60,7 @@ are overlayed will also be listed, with a " (skipped)" suffix. # factor - however, each layer.conf is free to either prepend or append to # BBPATH (or indeed do crazy stuff with it). Thus the order in BBPATH might # not be exactly the order present in bblayers.conf either. - bbpath = str(self.tinfoil.config_data.getVar('BBPATH', True)) + bbpath = str(self.tinfoil.config_data.getVar('BBPATH')) overlayed_class_found = False for (classfile, classdirs) in classes.items(): if len(classdirs) > 1: @@ -114,7 +112,7 @@ skipped recipes will also be listed, with a " (skipped)" suffix. def list_recipes(self, title, pnspec, show_overlayed_only, show_same_ver_only, show_filenames, show_multi_provider_only, inherits): if inherits: - bbpath = str(self.tinfoil.config_data.getVar('BBPATH', True)) + 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): @@ -122,15 +120,13 @@ skipped recipes will also be listed, with a " (skipped)" suffix. sys.exit(1) pkg_pn = self.tinfoil.cooker.recipecaches[''].pkg_pn - (latest_versions, preferred_versions) = bb.providers.findProviders(self.tinfoil.config_data, self.tinfoil.cooker.recipecaches[''], pkg_pn) - allproviders = bb.providers.allProviders(self.tinfoil.cooker.recipecaches['']) + (latest_versions, preferred_versions) = self.tinfoil.find_providers() + allproviders = self.tinfoil.get_all_providers() # Ensure we list skipped recipes # We are largely guessing about PN, PV and the preferred version here, # but we have no choice since skipped recipes are not fully parsed skiplist = list(self.tinfoil.cooker.skiplist.keys()) - skiplist.sort( key=lambda fileitem: self.tinfoil.cooker.collection.calc_bbfile_priority(fileitem) ) - skiplist.reverse() for fn in skiplist: recipe_parts = os.path.splitext(os.path.basename(fn))[0].split('_') p = recipe_parts[0] @@ -158,7 +154,7 @@ skipped recipes will also be listed, with a " (skipped)" suffix. logger.plain("%s:", pn) logger.plain(" %s %s%s", layer.ljust(20), ver, skipped) - global_inherit = (self.tinfoil.config_data.getVar('INHERIT', True) or "").split() + global_inherit = (self.tinfoil.config_data.getVar('INHERIT') or "").split() cls_re = re.compile('classes/') preffiles = [] @@ -246,17 +242,22 @@ skipped recipes will also be listed, with a " (skipped)" suffix. Lists recipes with the bbappends that apply to them as subitems. """ - - logger.plain('=== Appended recipes ===') + if args.pnspec: + logger.plain('=== Matched appended recipes ===') + else: + logger.plain('=== Appended recipes ===') pnlist = list(self.tinfoil.cooker_data.pkg_pn.keys()) pnlist.sort() appends = False for pn in pnlist: + if args.pnspec and pn != args.pnspec: + continue + if self.show_appends_for_pn(pn): appends = True - if self.show_appends_for_skipped(): + if not args.pnspec and self.show_appends_for_skipped(): appends = True if not appends: @@ -265,10 +266,7 @@ Lists recipes with the bbappends that apply to them as subitems. def show_appends_for_pn(self, pn): filenames = self.tinfoil.cooker_data.pkg_pn[pn] - best = bb.providers.findBestProvider(pn, - self.tinfoil.config_data, - self.tinfoil.cooker_data, - self.tinfoil.cooker_data.pkg_pn) + best = self.tinfoil.find_best_provider(pn) best_filename = os.path.basename(best[3]) return self.show_appends_output(filenames, best_filename) @@ -319,12 +317,12 @@ NOTE: .bbappend files can impact the dependencies. ignore_layers = (args.ignore or '').split(',') pkg_fn = self.tinfoil.cooker_data.pkg_fn - bbpath = str(self.tinfoil.config_data.getVar('BBPATH', True)) + bbpath = str(self.tinfoil.config_data.getVar('BBPATH')) self.require_re = re.compile(r"require\s+(.+)") self.include_re = re.compile(r"include\s+(.+)") self.inherit_re = re.compile(r"inherit\s+(.+)") - global_inherit = (self.tinfoil.config_data.getVar('INHERIT', True) or "").split() + global_inherit = (self.tinfoil.config_data.getVar('INHERIT') or "").split() # The bb's DEPENDS and RDEPENDS for f in pkg_fn: @@ -336,10 +334,7 @@ NOTE: .bbappend files can impact the dependencies. deps = self.tinfoil.cooker_data.deps[f] for pn in deps: if pn in self.tinfoil.cooker_data.pkg_pn: - best = bb.providers.findBestProvider(pn, - self.tinfoil.config_data, - self.tinfoil.cooker_data, - self.tinfoil.cooker_data.pkg_pn) + best = self.tinfoil.find_best_provider(pn) self.check_cross_depends("DEPENDS", layername, f, best[3], args.filenames, ignore_layers) # The RDPENDS @@ -352,14 +347,11 @@ NOTE: .bbappend files can impact the dependencies. sorted_rdeps[k2] = 1 all_rdeps = sorted_rdeps.keys() for rdep in all_rdeps: - all_p = bb.providers.getRuntimeProviders(self.tinfoil.cooker_data, rdep) + all_p, best = self.tinfoil.get_runtime_providers(rdep) if all_p: if f in all_p: # The recipe provides this one itself, ignore continue - best = bb.providers.filterProvidersRunTime(all_p, rdep, - self.tinfoil.config_data, - self.tinfoil.cooker_data)[0][0] self.check_cross_depends("RDEPENDS", layername, f, best, args.filenames, ignore_layers) # The RRECOMMENDS @@ -372,14 +364,11 @@ NOTE: .bbappend files can impact the dependencies. sorted_rrecs[k2] = 1 all_rrecs = sorted_rrecs.keys() for rrec in all_rrecs: - all_p = bb.providers.getRuntimeProviders(self.tinfoil.cooker_data, rrec) + all_p, best = self.tinfoil.get_runtime_providers(rrec) if all_p: if f in all_p: # The recipe provides this one itself, ignore continue - best = bb.providers.filterProvidersRunTime(all_p, rrec, - self.tinfoil.config_data, - self.tinfoil.cooker_data)[0][0] self.check_cross_depends("RRECOMMENDS", layername, f, best, args.filenames, ignore_layers) # The inherit class @@ -493,7 +482,8 @@ NOTE: .bbappend files can impact the dependencies. parser_show_recipes.add_argument('-i', '--inherits', help='only list recipes that inherit the named class', metavar='CLASS', default='') parser_show_recipes.add_argument('pnspec', nargs='?', help='optional recipe name specification (wildcards allowed, enclose in quotes to avoid shell expansion)') - self.add_command(sp, 'show-appends', self.do_show_appends) + 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_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') |