]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: tinfoil: ensure get_recipe_info() returns Null if recipe not found
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Wed, 8 Nov 2017 02:20:27 +0000 (15:20 +1300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 21 Nov 2017 13:06:45 +0000 (13:06 +0000)
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>
bitbake/lib/bb/tinfoil.py

index fa95f6329f89a961487053c4f66d10596769fd1b..368264f39ab72297a1256270b7644e36a97afb34 100644 (file)
@@ -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):
         """