diff options
author | Chris Larson <chris_larson@mentor.com> | 2010-06-08 12:28:36 -0700 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-07-02 15:41:35 +0100 |
commit | 75d49840cf1e7df9625f3c6d8bfb400599b66f84 (patch) | |
tree | ec27f6882350af7e8d9fdd8e642aea0991c702e6 /bitbake | |
parent | 1b6af2787e5842ef8e933c5ffda172664095832e (diff) | |
download | openembedded-core-75d49840cf1e7df9625f3c6d8bfb400599b66f84.tar.gz openembedded-core-75d49840cf1e7df9625f3c6d8bfb400599b66f84.tar.bz2 openembedded-core-75d49840cf1e7df9625f3c6d8bfb400599b66f84.tar.xz openembedded-core-75d49840cf1e7df9625f3c6d8bfb400599b66f84.zip |
Reorganize the main exception handling so an attribute exception raised in the ui isn't misinterpreted
(Bitbake rev: 49b8bab706c59e93287f8540187b62ba3ece0a11)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake')
-rwxr-xr-x | bitbake/bin/bitbake | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake index 600cdadc9..9580784e5 100755 --- a/bitbake/bin/bitbake +++ b/bitbake/bin/bitbake @@ -87,7 +87,7 @@ warnings.simplefilter("ignore", DeprecationWarning) #============================================================================# def main(): - return_value = 0 + return_value = 1 parser = optparse.OptionParser( version = "BitBake Build Tool Core version %s, %%prog version %s" % (bb.__version__, __version__), @@ -201,13 +201,16 @@ Default BBFILES are the .bb files in the current directory.""") # suggest a fixed set this allows you to have flexibility in which # ones are available. uimodule = __import__("bb.ui", fromlist = [ui]) - return_value = getattr(uimodule, ui).init(serverConnection.connection, serverConnection.events) + ui_init = getattr(uimodule, ui).init except AttributeError: print "FATAL: Invalid user interface '%s' specified. " % ui print "Valid interfaces are 'ncurses', 'depexp' or the default, 'knotty'." - except Exception, e: - print "FATAL: Unable to start to '%s' UI: %s" % (configuration.ui, e) - raise + else: + try: + return_value = ui_init(serverConnection.connection, serverConnection.events) + except Exception, e: + print "FATAL: Unable to start to '%s' UI: %s" % (ui, e) + raise finally: serverConnection.terminate() return return_value |