summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorYeoh Ee Peng <ee.peng.yeoh@intel.com>2019-09-19 18:11:08 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-09-19 20:30:35 +0100
commit5808f455f02dfa8e3c051ccfe73d730a050db098 (patch)
treeae652c71f285c77e9558a5752888f1aa66a68cf9 /bitbake/lib
parent7e7cce5f36f5ff5e699781c3ae3b51b6139ba2c6 (diff)
downloadpoky-5808f455f02dfa8e3c051ccfe73d730a050db098.tar.gz
bitbake: bitbake-layers: show-recipes: Show recipes only
Currently, show-recipes will show all recipes available (both recipes with different version and recipes provided by more than one layer). Example of default $ bitbake-layers show-recipes: core-image-rt: meta-intel unknown (skipped) meta unknown (skipped) yajl: meta-oe 2.1.0 meta-oe 1.0.12 Add -r/--recipes-only to enable showing recipes only. This provide a focus view on unique recipes available. Example of $ bitbake-layers show-recipes -r: core-image-rt (skipped) yajl (Bitbake rev: 048bd051a9b422a38c181f57bb5090a05684a5c3) Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bblayers/query.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/bitbake/lib/bblayers/query.py b/bitbake/lib/bblayers/query.py
index 993589de94..84168a19e7 100644
--- a/bitbake/lib/bblayers/query.py
+++ b/bitbake/lib/bblayers/query.py
@@ -46,7 +46,7 @@ layer, with the preferred version first. Note that skipped recipes that
46are overlayed will also be listed, with a " (skipped)" suffix. 46are overlayed will also be listed, with a " (skipped)" suffix.
47""" 47"""
48 48
49 items_listed = self.list_recipes('Overlayed recipes', None, True, args.same_version, args.filenames, True, None) 49 items_listed = self.list_recipes('Overlayed recipes', None, True, args.same_version, args.filenames, False, True, None)
50 50
51 # Check for overlayed .bbclass files 51 # Check for overlayed .bbclass files
52 classes = collections.defaultdict(list) 52 classes = collections.defaultdict(list)
@@ -112,9 +112,9 @@ skipped recipes will also be listed, with a " (skipped)" suffix.
112 title = 'Matching recipes:' 112 title = 'Matching recipes:'
113 else: 113 else:
114 title = 'Available recipes:' 114 title = 'Available recipes:'
115 self.list_recipes(title, args.pnspec, False, False, args.filenames, args.multiple, inheritlist) 115 self.list_recipes(title, args.pnspec, False, False, args.filenames, args.recipes_only, args.multiple, inheritlist)
116 116
117 def list_recipes(self, title, pnspec, show_overlayed_only, show_same_ver_only, show_filenames, show_multi_provider_only, inherits): 117 def list_recipes(self, title, pnspec, show_overlayed_only, show_same_ver_only, show_filenames, show_recipes_only, show_multi_provider_only, inherits):
118 if inherits: 118 if inherits:
119 bbpath = str(self.tinfoil.config_data.getVar('BBPATH')) 119 bbpath = str(self.tinfoil.config_data.getVar('BBPATH'))
120 for classname in inherits: 120 for classname in inherits:
@@ -153,6 +153,10 @@ skipped recipes will also be listed, with a " (skipped)" suffix.
153 logger.plain("%s%s", f, skipped) 153 logger.plain("%s%s", f, skipped)
154 else: 154 else:
155 logger.plain(" %s%s", f, skipped) 155 logger.plain(" %s%s", f, skipped)
156 elif show_recipes_only:
157 if pn not in show_unique_pn:
158 show_unique_pn.append(pn)
159 logger.plain("%s%s", pn, skipped)
156 else: 160 else:
157 if ispref: 161 if ispref:
158 logger.plain("%s:", pn) 162 logger.plain("%s:", pn)
@@ -162,6 +166,7 @@ skipped recipes will also be listed, with a " (skipped)" suffix.
162 cls_re = re.compile('classes/') 166 cls_re = re.compile('classes/')
163 167
164 preffiles = [] 168 preffiles = []
169 show_unique_pn = []
165 items_listed = False 170 items_listed = False
166 for p in sorted(pkg_pn): 171 for p in sorted(pkg_pn):
167 if pnspec: 172 if pnspec:
@@ -493,6 +498,7 @@ NOTE: .bbappend files can impact the dependencies.
493 498
494 parser_show_recipes = self.add_command(sp, 'show-recipes', self.do_show_recipes) 499 parser_show_recipes = self.add_command(sp, 'show-recipes', self.do_show_recipes)
495 parser_show_recipes.add_argument('-f', '--filenames', help='instead of the default formatting, list filenames of higher priority recipes with the ones they overlay indented underneath', action='store_true') 500 parser_show_recipes.add_argument('-f', '--filenames', help='instead of the default formatting, list filenames of higher priority recipes with the ones they overlay indented underneath', action='store_true')
501 parser_show_recipes.add_argument('-r', '--recipes-only', help='instead of the default formatting, list recipes only', action='store_true')
496 parser_show_recipes.add_argument('-m', '--multiple', help='only list where multiple recipes (in the same layer or different layers) exist for the same recipe name', action='store_true') 502 parser_show_recipes.add_argument('-m', '--multiple', help='only list where multiple recipes (in the same layer or different layers) exist for the same recipe name', action='store_true')
497 parser_show_recipes.add_argument('-i', '--inherits', help='only list recipes that inherit the named class(es) - separate multiple classes using , (without spaces)', metavar='CLASS', default='') 503 parser_show_recipes.add_argument('-i', '--inherits', help='only list recipes that inherit the named class(es) - separate multiple classes using , (without spaces)', metavar='CLASS', default='')
498 parser_show_recipes.add_argument('pnspec', nargs='*', help='optional recipe name specification (wildcards allowed, enclose in quotes to avoid shell expansion)') 504 parser_show_recipes.add_argument('pnspec', nargs='*', help='optional recipe name specification (wildcards allowed, enclose in quotes to avoid shell expansion)')