summaryrefslogtreecommitdiffstats
path: root/bitbake/bin/bitbake
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-06-08 12:28:36 -0700
committerRichard Purdie <rpurdie@linux.intel.com>2010-07-02 15:41:35 +0100
commit75d49840cf1e7df9625f3c6d8bfb400599b66f84 (patch)
treeec27f6882350af7e8d9fdd8e642aea0991c702e6 /bitbake/bin/bitbake
parent1b6af2787e5842ef8e933c5ffda172664095832e (diff)
downloadpoky-75d49840cf1e7df9625f3c6d8bfb400599b66f84.tar.gz
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/bin/bitbake')
-rwxr-xr-xbitbake/bin/bitbake13
1 files changed, 8 insertions, 5 deletions
diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake
index 600cdadc9d..9580784e55 100755
--- a/bitbake/bin/bitbake
+++ b/bitbake/bin/bitbake
@@ -87,7 +87,7 @@ warnings.simplefilter("ignore", DeprecationWarning)
87#============================================================================# 87#============================================================================#
88 88
89def main(): 89def main():
90 return_value = 0 90 return_value = 1
91 91
92 parser = optparse.OptionParser( 92 parser = optparse.OptionParser(
93 version = "BitBake Build Tool Core version %s, %%prog version %s" % (bb.__version__, __version__), 93 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.""")
201 # suggest a fixed set this allows you to have flexibility in which 201 # suggest a fixed set this allows you to have flexibility in which
202 # ones are available. 202 # ones are available.
203 uimodule = __import__("bb.ui", fromlist = [ui]) 203 uimodule = __import__("bb.ui", fromlist = [ui])
204 return_value = getattr(uimodule, ui).init(serverConnection.connection, serverConnection.events) 204 ui_init = getattr(uimodule, ui).init
205 except AttributeError: 205 except AttributeError:
206 print "FATAL: Invalid user interface '%s' specified. " % ui 206 print "FATAL: Invalid user interface '%s' specified. " % ui
207 print "Valid interfaces are 'ncurses', 'depexp' or the default, 'knotty'." 207 print "Valid interfaces are 'ncurses', 'depexp' or the default, 'knotty'."
208 except Exception, e: 208 else:
209 print "FATAL: Unable to start to '%s' UI: %s" % (configuration.ui, e) 209 try:
210 raise 210 return_value = ui_init(serverConnection.connection, serverConnection.events)
211 except Exception, e:
212 print "FATAL: Unable to start to '%s' UI: %s" % (ui, e)
213 raise
211 finally: 214 finally:
212 serverConnection.terminate() 215 serverConnection.terminate()
213 return return_value 216 return return_value