aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2017-09-20 16:41:28 +1200
committerPaul Eggleton <paul.eggleton@linux.intel.com>2017-11-08 15:18:35 +1300
commit51bdd2d5ba3a51269422b9bbdba6d0249f82e3dd (patch)
treefd3299cf28c67d1524573d86b99b4b7d821e5bf6
parente1e8565b5e19dd3f7ef6e7e41932456adaa3df81 (diff)
downloadbitbake-contrib-51bdd2d5ba3a51269422b9bbdba6d0249f82e3dd.tar.gz
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. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
-rw-r--r--lib/bb/tinfoil.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/bb/tinfoil.py b/lib/bb/tinfoil.py
index fb2ee4ad9..8bac394ad 100644
--- a/lib/bb/tinfoil.py
+++ b/lib/bb/tinfoil.py
@@ -604,13 +604,16 @@ class Tinfoil:
recipecache = self.cooker.recipecaches[mc]
prov = self.find_best_provider(pn)
fn = prov[3]
- actual_pn = recipecache.pkg_fn[fn]
- recipe = TinfoilRecipeInfo(recipecache,
- self.config_data,
- pn=actual_pn,
- fn=fn,
- fns=recipecache.pkg_pn[actual_pn])
- return recipe
+ if fn:
+ actual_pn = recipecache.pkg_fn[fn]
+ recipe = TinfoilRecipeInfo(recipecache,
+ self.config_data,
+ pn=actual_pn,
+ fn=fn,
+ fns=recipecache.pkg_pn[actual_pn])
+ return recipe
+ else:
+ return None
def parse_recipe(self, pn):
"""