summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-12-13 16:24:14 -0700
committerRichard Purdie <rpurdie@linux.intel.com>2011-01-04 14:46:50 +0000
commit9260c08e1d4d2cf62639a77e8ca28ef0f30ab4be (patch)
treea5212a87c3da0e3440b8dbc2516bf2fbca715530
parente05d6fa92792829e9bb1d77a4d5edb5382e68ff0 (diff)
downloadpoky-9260c08e1d4d2cf62639a77e8ca28ef0f30ab4be.tar.gz
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>
-rwxr-xr-xbitbake/bin/bitbake31
1 files changed, 20 insertions, 11 deletions
diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake
index 6458d987c0..61bd0194d6 100755
--- a/bitbake/bin/bitbake
+++ b/bitbake/bin/bitbake
@@ -57,6 +57,23 @@ class BBConfiguration(object):
57 self.pkgs_to_build = [] 57 self.pkgs_to_build = []
58 58
59 59
60def get_ui(config):
61 if config.ui:
62 interface = config.ui
63 else:
64 interface = 'knotty'
65
66 try:
67 # Dynamically load the UI based on the ui name. Although we
68 # suggest a fixed set this allows you to have flexibility in which
69 # ones are available.
70 module = __import__("bb.ui", fromlist = [interface])
71 return getattr(module, interface).main
72 except AttributeError:
73 sys.exit("FATAL: Invalid user interface '%s' specified.\n"
74 "Valid interfaces: ncurses, depexp, knotty [default]." % interface)
75
76
60# Display bitbake/OE warnings via the BitBake.Warnings logger, ignoring others""" 77# Display bitbake/OE warnings via the BitBake.Warnings logger, ignoring others"""
61warnlog = logging.getLogger("BitBake.Warnings") 78warnlog = logging.getLogger("BitBake.Warnings")
62_warnings_showwarning = warnings.showwarning 79_warnings_showwarning = warnings.showwarning
@@ -153,6 +170,8 @@ Default BBFILES are the .bb files in the current directory.""")
153 configuration.pkgs_to_build.extend(args[1:]) 170 configuration.pkgs_to_build.extend(args[1:])
154 configuration.initial_path = os.environ['PATH'] 171 configuration.initial_path = os.environ['PATH']
155 172
173 ui_main = get_ui(configuration)
174
156 loghandler = event.LogHandler() 175 loghandler = event.LogHandler()
157 logger.addHandler(loghandler) 176 logger.addHandler(loghandler)
158 177
@@ -191,17 +210,7 @@ Default BBFILES are the .bb files in the current directory.""")
191 ui = "knotty" 210 ui = "knotty"
192 211
193 try: 212 try:
194 try: 213 return server.BitbakeUILauch().launch(serverinfo, ui_main, server_connection.connection, server_connection.events)
195 # Dynamically load the UI based on the ui name. Although we
196 # suggest a fixed set this allows you to have flexibility in which
197 # ones are available.
198 module = __import__("bb.ui", fromlist = [ui])
199 ui_main = getattr(module, ui).main
200 except AttributeError:
201 print("FATAL: Invalid user interface '%s' specified. " % ui)
202 print("Valid interfaces are 'ncurses', 'depexp' or the default, 'knotty'.")
203 else:
204 return server.BitbakeUILauch().launch(serverinfo, ui_main, server_connection.connection, server_connection.events)
205 finally: 214 finally:
206 server_connection.terminate() 215 server_connection.terminate()
207 216