bitbake: tinfoil: ensure get_recipe_info() returns Null if recipe not found

If a matching recipe is not found then return Null instead of raising
KeyError because we were blindly using None as a key for pkg_fn.

(Bitbake rev: 431e89e322850a2497157c3c0843da9df6bc9a3e)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Paul Eggleton 2017-11-08 15:20:27 +13:00 committed by Richard Purdie
parent 62113c4fbb
commit 41c868d076

View File

@ -604,13 +604,16 @@ class Tinfoil:
recipecache = self.cooker.recipecaches[mc] recipecache = self.cooker.recipecaches[mc]
prov = self.find_best_provider(pn) prov = self.find_best_provider(pn)
fn = prov[3] fn = prov[3]
actual_pn = recipecache.pkg_fn[fn] if fn:
recipe = TinfoilRecipeInfo(recipecache, actual_pn = recipecache.pkg_fn[fn]
self.config_data, recipe = TinfoilRecipeInfo(recipecache,
pn=actual_pn, self.config_data,
fn=fn, pn=actual_pn,
fns=recipecache.pkg_pn[actual_pn]) fn=fn,
return recipe fns=recipecache.pkg_pn[actual_pn])
return recipe
else:
return None
def parse_recipe(self, pn): def parse_recipe(self, pn):
""" """