From: Richard Purdie Date: Tue, 7 May 2013 08:23:47 +0000 (+0000) Subject: bitbake: bin/bitbake: Ensure early errors are shown to the user X-Git-Tag: rev_ivi_2015_02_04~12650 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4d12b8368f6cafb0e826c8260d96674779b030d5;p=scm%2Fbb%2Ftizen-distro.git bitbake: bin/bitbake: Ensure early errors are shown to the user Currently if errors occur early in the init process, the errors may not be shown to the user. This change ensures that if a failure does occur, the messages are flushed from the queue and shown to the user. (Bitbake rev: fda84c4285e0bc31c249b6dd5464aeb6ad622a9a) Signed-off-by: Richard Purdie --- diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake index 0e69207..e05ff5b 100755 --- a/bitbake/bin/bitbake +++ b/bitbake/bin/bitbake @@ -240,11 +240,22 @@ Default BBFILES are the .bb files in the current directory.""") idle = server.getServerIdleCB() - cooker = bb.cooker.BBCooker(configuration, idle, initialenv) - cooker.parseCommandLine() - - server.addcooker(cooker) - server.saveConnectionDetails() + try: + cooker = bb.cooker.BBCooker(configuration, idle, initialenv) + cooker.parseCommandLine() + + server.addcooker(cooker) + server.saveConnectionDetails() + except: + while True: + import queue + try: + event = server.event_queue.get(block=False) + except (queue.Empty, IOError): + break + if isinstance(event, logging.LogRecord): + logger.handle(event) + raise server.detach() # Should no longer need to ever reference cooker