[oe-commits] [bitbake] 04/20: data: fix exception handling in exported_vars()
git at git.openembedded.org
git at git.openembedded.org
Fri Nov 4 12:55:44 UTC 2016
rpurdie pushed a commit to branch master
in repository bitbake.
commit f639f06cfa280adcc25438387567966271b9b2c3
Author: Markus Lehtonen <markus.lehtonen at linux.intel.com>
AuthorDate: Tue Nov 1 17:05:11 2016 +0200
data: fix exception handling in exported_vars()
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]
Signed-off-by: Markus Lehtonen <markus.lehtonen at linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
lib/bb/data.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/lib/bb/data.py b/lib/bb/data.py
index c1f27cd..c56965c 100644
--- a/lib/bb/data.py
+++ b/lib/bb/data.py
@@ -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)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list