recipes: support pn: query prefix

Allow filtering only on recipe name - i.e., searching for "git" finds
any recipe with "git" in the name or description. Now, you can search
for "pn:git" which will return only recipes with the name "git".

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
Paul Eggleton 2019-11-20 10:57:33 +13:00
parent 7eea41de30
commit 745ffd6958

View File

@ -576,6 +576,9 @@ layer name is expected to follow the \"layer:\" prefix without any spaces.')
messages.add_message(self.request, messages.ERROR,
'No layer \"%s\" was found.'
% query_layername)
elif item.startswith('pn:'):
query_pn = item.split(':')[1].strip().lower()
init_qs = init_qs.filter(pn=query_pn)
else:
if ' ' in item:
item = '"%s"' % item