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,6 +604,7 @@ 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]
if fn:
actual_pn = recipecache.pkg_fn[fn] actual_pn = recipecache.pkg_fn[fn]
recipe = TinfoilRecipeInfo(recipecache, recipe = TinfoilRecipeInfo(recipecache,
self.config_data, self.config_data,
@ -611,6 +612,8 @@ class Tinfoil:
fn=fn, fn=fn,
fns=recipecache.pkg_pn[actual_pn]) fns=recipecache.pkg_pn[actual_pn])
return recipe return recipe
else:
return None
def parse_recipe(self, pn): def parse_recipe(self, pn):
""" """