]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: data: fix exception handling in exported_vars()
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Tue, 1 Nov 2016 15:05:11 +0000 (17:05 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 16 Nov 2016 10:37:58 +0000 (10:37 +0000)
Fix a bug where a totally wrong value of a variable would be exported if
an exception happened during d.getVar(). Also, print a warning if an
exception happends instead of silently ignoring it. It would probably be
best just to raise the exception, instead, but use the warning for now
in order to avoid breaking existing builds.

[YOCTO #10393]

(Bitbake rev: 59c606cfc6e0a4f367344d4e3def6017fb560d75)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/data.py

index c1f27cd0c301361098f80d7f83e69c13ac0061c0..c56965c602b6a43bbe51cbb07792f74b7d9db4c0 100644 (file)
@@ -258,11 +258,13 @@ def exported_keys(d):
                                       not d.getVarFlag(key, 'unexport', False))
 
 def exported_vars(d):
-    for key in exported_keys(d):
+    k = list(exported_keys(d))
+    for key in k:
         try:
             value = d.getVar(key, True)
-        except Exception:
-            pass
+        except Exception as err:
+            bb.warn("%s: Unable to export ${%s}: %s" % (d.getVar("FILE", True), key, err))
+            continue
 
         if value is not None:
             yield key, str(value)