diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2016-11-01 17:05:11 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-11-16 10:37:58 +0000 |
commit | 8472ed0c89771d87c42c0256cb8f95454270f9d6 (patch) | |
tree | 12fc56182a96db336d02a7bf457cbbd8ce78ec43 /bitbake/lib/bb | |
parent | a34582a85ebf48c4865a2563443ac8dd075c15fa (diff) | |
download | poky-8472ed0c89771d87c42c0256cb8f95454270f9d6.tar.gz |
bitbake: 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]
(Bitbake rev: 59c606cfc6e0a4f367344d4e3def6017fb560d75)
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r-- | bitbake/lib/bb/data.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py index c1f27cd0c3..c56965c602 100644 --- a/bitbake/lib/bb/data.py +++ b/bitbake/lib/bb/data.py | |||
@@ -258,11 +258,13 @@ def exported_keys(d): | |||
258 | not d.getVarFlag(key, 'unexport', False)) | 258 | not d.getVarFlag(key, 'unexport', False)) |
259 | 259 | ||
260 | def exported_vars(d): | 260 | def exported_vars(d): |
261 | for key in exported_keys(d): | 261 | k = list(exported_keys(d)) |
262 | for key in k: | ||
262 | try: | 263 | try: |
263 | value = d.getVar(key, True) | 264 | value = d.getVar(key, True) |
264 | except Exception: | 265 | except Exception as err: |
265 | pass | 266 | bb.warn("%s: Unable to export ${%s}: %s" % (d.getVar("FILE", True), key, err)) |
267 | continue | ||
266 | 268 | ||
267 | if value is not None: | 269 | if value is not None: |
268 | yield key, str(value) | 270 | yield key, str(value) |