diff options
author | Chris Larson <chris_larson@mentor.com> | 2010-12-13 16:24:14 -0700 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2011-01-04 14:46:50 +0000 |
commit | 9260c08e1d4d2cf62639a77e8ca28ef0f30ab4be (patch) | |
tree | a5212a87c3da0e3440b8dbc2516bf2fbca715530 /bitbake/bin | |
parent | e05d6fa92792829e9bb1d77a4d5edb5382e68ff0 (diff) | |
download | openembedded-core-9260c08e1d4d2cf62639a77e8ca28ef0f30ab4be.tar.gz openembedded-core-9260c08e1d4d2cf62639a77e8ca28ef0f30ab4be.tar.bz2 openembedded-core-9260c08e1d4d2cf62639a77e8ca28ef0f30ab4be.tar.xz openembedded-core-9260c08e1d4d2cf62639a77e8ca28ef0f30ab4be.zip |
Ensure that the invalid UI error goes to stderr
(Bitbake rev: 76aeea2c23a518046d0b26f1a6fc43287a180a9d)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/bin')
-rwxr-xr-x | bitbake/bin/bitbake | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake index 6458d987c..61bd0194d 100755 --- a/bitbake/bin/bitbake +++ b/bitbake/bin/bitbake @@ -57,6 +57,23 @@ class BBConfiguration(object): self.pkgs_to_build = [] +def get_ui(config): + if config.ui: + interface = config.ui + else: + interface = 'knotty' + + try: + # Dynamically load the UI based on the ui name. Although we + # suggest a fixed set this allows you to have flexibility in which + # ones are available. + module = __import__("bb.ui", fromlist = [interface]) + return getattr(module, interface).main + except AttributeError: + sys.exit("FATAL: Invalid user interface '%s' specified.\n" + "Valid interfaces: ncurses, depexp, knotty [default]." % interface) + + # Display bitbake/OE warnings via the BitBake.Warnings logger, ignoring others""" warnlog = logging.getLogger("BitBake.Warnings") _warnings_showwarning = warnings.showwarning @@ -153,6 +170,8 @@ Default BBFILES are the .bb files in the current directory.""") configuration.pkgs_to_build.extend(args[1:]) configuration.initial_path = os.environ['PATH'] + ui_main = get_ui(configuration) + loghandler = event.LogHandler() logger.addHandler(loghandler) @@ -191,17 +210,7 @@ Default BBFILES are the .bb files in the current directory.""") ui = "knotty" try: - try: - # Dynamically load the UI based on the ui name. Although we - # suggest a fixed set this allows you to have flexibility in which - # ones are available. - module = __import__("bb.ui", fromlist = [ui]) - ui_main = getattr(module, ui).main - except AttributeError: - print("FATAL: Invalid user interface '%s' specified. " % ui) - print("Valid interfaces are 'ncurses', 'depexp' or the default, 'knotty'.") - else: - return server.BitbakeUILauch().launch(serverinfo, ui_main, server_connection.connection, server_connection.events) + return server.BitbakeUILauch().launch(serverinfo, ui_main, server_connection.connection, server_connection.events) finally: server_connection.terminate() |