From: Ed Bartosh Date: Tue, 28 Apr 2015 11:27:34 +0000 (+0300) Subject: bitbake: bitbake: Handle BBMainException X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47e2dbd89a92faca3e188d509c5629c59feca770;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git bitbake: bitbake: Handle BBMainException Some error messages were lost because BBMainException was inherited from bb.BBHandledException. When bb.BBHandledException is processed error messages are not printed as they suppose to be printed before raising this exception. Stopped to inherit BBMainException from bb.BBHandledException. Handled BBMainException in bin/bitbake and printed error message to the stderr. (Bitbake rev: c8e2a40c4e9865ebef9936d23644f2602a5c90f5) Signed-off-by: Ed Bartosh Signed-off-by: Richard Purdie --- diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake index af915075dcf..3e1ca6286c6 100755 --- a/bitbake/bin/bitbake +++ b/bitbake/bin/bitbake @@ -33,12 +33,15 @@ except RuntimeError as exc: sys.exit(str(exc)) from bb import cookerdata -from bb.main import bitbake_main, BitBakeConfigParameters +from bb.main import bitbake_main, BitBakeConfigParameters, BBMainException if __name__ == "__main__": try: ret = bitbake_main(BitBakeConfigParameters(sys.argv), cookerdata.CookerConfiguration()) + except BBMainException as err: + print >>sys.stderr, err + ret = 1 except bb.BBHandledException: ret = 1 except Exception: diff --git a/bitbake/lib/bb/main.py b/bitbake/lib/bb/main.py index af067f73793..2019d5014b6 100755 --- a/bitbake/lib/bb/main.py +++ b/bitbake/lib/bb/main.py @@ -39,7 +39,7 @@ from bb import cookerdata __version__ = "1.27.0" logger = logging.getLogger("BitBake") -class BBMainException(bb.BBHandledException): +class BBMainException(Exception): pass def get_ui(config):