From ebc0d4252a19e6ab38052473e54138d29b172dfc Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Thu, 23 Feb 2012 17:38:07 +0000 Subject: bitbake: fix parse errors not being reported Fixes a regression introduced in BitBake rev c9f58ef6b897d3fa5b0d23734b5f2cb3dabb057a which prevents errors during parsing from being fully reported because BitBake shuts down before it can print them. Move the error printing to before the shutdown in order to fix it. Also remove a couple of superfluous calls to sys.exit() since these will never be called (as self.shutdown(clean=False) does this itself). (Bitbake rev: 356c42ed00541dea2c382c57f768a4f431d22db0) Signed-off-by: Paul Eggleton Signed-off-by: Richard Purdie --- bitbake/lib/bb/cooker.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'bitbake') diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index f0778e5a46..308805a712 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py @@ -1605,22 +1605,20 @@ class CookerParser(object): self.shutdown() return False except ParsingFailure as exc: - self.shutdown(clean=False) - bb.fatal('Unable to parse %s: %s' % + logger.error('Unable to parse %s: %s' % (exc.recipe, bb.exceptions.to_string(exc.realexception))) + self.shutdown(clean=False) except (bb.parse.ParseError, bb.data_smart.ExpansionError) as exc: + logger.error(str(exc)) self.shutdown(clean=False) - bb.fatal(str(exc)) except SyntaxError as exc: - self.shutdown(clean=False) logger.error('Unable to parse %s', exc.recipe) - sys.exit(1) + self.shutdown(clean=False) except Exception as exc: etype, value, tb = sys.exc_info() logger.error('Unable to parse %s', value.recipe, exc_info=(etype, value, exc.traceback)) self.shutdown(clean=False) - sys.exit(1) self.current += 1 self.virtuals += len(result) -- cgit v1.2.3-54-g00ecf