aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/cookerdata.py
diff options
context:
space:
mode:
authorChristopher Larson <chris_larson@mentor.com>2015-08-24 15:32:00 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-04 16:23:59 +0100
commit7c4fdb8c178a2a48ee8c3a203dcac51b32c5ad1d (patch)
tree019b0df260fbcb4e4eea4fc5cbdcd57ce2466549 /bitbake/lib/bb/cookerdata.py
parent5fe590cd6e60cba7b7f52826629e57e8ac67e195 (diff)
downloadopenembedded-core-contrib-7c4fdb8c178a2a48ee8c3a203dcac51b32c5ad1d.tar.gz
bitbake: bb.cookerdata: include useful traceback for ExpansionError/ParseError
Show the user only the portion of the traceback which was from the metadata, nothing from bitbake's internal calls. (Bitbake rev: c45054aef03393fa0bf70e853ddcfc55988493cf) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/cookerdata.py')
-rw-r--r--bitbake/lib/bb/cookerdata.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py
index b20040c0b3..f19c283884 100644
--- a/bitbake/lib/bb/cookerdata.py
+++ b/bitbake/lib/bb/cookerdata.py
@@ -180,7 +180,16 @@ def catch_parse_error(func):
parselog.critical("Unable to parse %s: %s" % (fn, exc))
sys.exit(1)
except (bb.parse.ParseError, bb.data_smart.ExpansionError) as exc:
- parselog.critical("Unable to parse %s: %s" % (fn, exc))
+ import traceback
+
+ bbdir = os.path.dirname(__file__) + os.sep
+ exc_class, exc, tb = sys.exc_info()
+ for tb in iter(lambda: tb.tb_next, None):
+ # Skip frames in bitbake itself, we only want the metadata
+ fn, _, _, _ = traceback.extract_tb(tb, 1)[0]
+ if not fn.startswith(bbdir):
+ break
+ parselog.critical("Unable to parse %s", fn, exc_info=(exc_class, exc, tb))
sys.exit(1)
return wrapped