summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/bblayers/query.py40
1 files changed, 21 insertions, 19 deletions
diff --git a/bitbake/lib/bblayers/query.py b/bitbake/lib/bblayers/query.py
index 84168a19e7..a100f663e1 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, False, True, None) 49 items_listed = self.list_recipes('Overlayed recipes', None, True, args.same_version, args.filenames, False, True, None, 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.recipes_only, args.multiple, inheritlist) 115 self.list_recipes(title, args.pnspec, False, False, args.filenames, args.recipes_only, args.multiple, args.layer, inheritlist)
116 116
117 def list_recipes(self, title, pnspec, show_overlayed_only, show_same_ver_only, show_filenames, show_recipes_only, 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, selected_layer, 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:
@@ -144,23 +144,24 @@ skipped recipes will also be listed, with a " (skipped)" suffix.
144 preferred_versions[p] = (ver, fn) 144 preferred_versions[p] = (ver, fn)
145 145
146 def print_item(f, pn, ver, layer, ispref): 146 def print_item(f, pn, ver, layer, ispref):
147 if f in skiplist: 147 if not selected_layer or layer == selected_layer:
148 skipped = ' (skipped)' 148 if f in skiplist:
149 else: 149 skipped = ' (skipped)'
150 skipped = ''
151 if show_filenames:
152 if ispref:
153 logger.plain("%s%s", f, skipped)
154 else: 150 else:
155 logger.plain(" %s%s", f, skipped) 151 skipped = ''
156 elif show_recipes_only: 152 if show_filenames:
157 if pn not in show_unique_pn: 153 if ispref:
158 show_unique_pn.append(pn) 154 logger.plain("%s%s", f, skipped)
159 logger.plain("%s%s", pn, skipped) 155 else:
160 else: 156 logger.plain(" %s%s", f, skipped)
161 if ispref: 157 elif show_recipes_only:
162 logger.plain("%s:", pn) 158 if pn not in show_unique_pn:
163 logger.plain(" %s %s%s", layer.ljust(20), ver, skipped) 159 show_unique_pn.append(pn)
160 logger.plain("%s%s", pn, skipped)
161 else:
162 if ispref:
163 logger.plain("%s:", pn)
164 logger.plain(" %s %s%s", layer.ljust(20), ver, skipped)
164 165
165 global_inherit = (self.tinfoil.config_data.getVar('INHERIT') or "").split() 166 global_inherit = (self.tinfoil.config_data.getVar('INHERIT') or "").split()
166 cls_re = re.compile('classes/') 167 cls_re = re.compile('classes/')
@@ -501,6 +502,7 @@ NOTE: .bbappend files can impact the dependencies.
501 parser_show_recipes.add_argument('-r', '--recipes-only', help='instead of the default formatting, list recipes only', action='store_true') 502 parser_show_recipes.add_argument('-r', '--recipes-only', help='instead of the default formatting, list recipes only', 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') 503 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')
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='') 504 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='')
505 parser_show_recipes.add_argument('-l', '--layer', help='only list recipes from the selected layer', default='')
504 parser_show_recipes.add_argument('pnspec', nargs='*', help='optional recipe name specification (wildcards allowed, enclose in quotes to avoid shell expansion)') 506 parser_show_recipes.add_argument('pnspec', nargs='*', help='optional recipe name specification (wildcards allowed, enclose in quotes to avoid shell expansion)')
505 507
506 parser_show_appends = self.add_command(sp, 'show-appends', self.do_show_appends) 508 parser_show_appends = self.add_command(sp, 'show-appends', self.do_show_appends)