diff options
Diffstat (limited to 'bitbake/lib/bb/ui/knotty.py')
-rw-r--r-- | bitbake/lib/bb/ui/knotty.py | 45 |
1 files changed, 31 insertions, 14 deletions
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py index 01674169ec..439a792800 100644 --- a/bitbake/lib/bb/ui/knotty.py +++ b/bitbake/lib/bb/ui/knotty.py | |||
@@ -107,9 +107,18 @@ class TerminalFilter(object): | |||
107 | def main(server, eventHandler, tf = TerminalFilter): | 107 | def main(server, eventHandler, tf = TerminalFilter): |
108 | 108 | ||
109 | # Get values of variables which control our output | 109 | # Get values of variables which control our output |
110 | includelogs = server.runCommand(["getVariable", "BBINCLUDELOGS"]) | 110 | includelogs, error = server.runCommand(["getVariable", "BBINCLUDELOGS"]) |
111 | loglines = server.runCommand(["getVariable", "BBINCLUDELOGS_LINES"]) | 111 | if error: |
112 | consolelogfile = server.runCommand(["getVariable", "BB_CONSOLELOG"]) | 112 | logger.error("Unable to get the value of BBINCLUDELOGS variable: %s" % error) |
113 | return 1 | ||
114 | loglines, error = server.runCommand(["getVariable", "BBINCLUDELOGS_LINES"]) | ||
115 | if error: | ||
116 | logger.error("Unable to get the value of BBINCLUDELOGS_LINES variable: %s" % error) | ||
117 | return 1 | ||
118 | consolelogfile, error = server.runCommand(["getVariable", "BB_CONSOLELOG"]) | ||
119 | if error: | ||
120 | logger.error("Unable to get the value of BB_CONSOLELOG variable: %s" % error) | ||
121 | return 1 | ||
113 | 122 | ||
114 | helper = uihelper.BBUIHelper() | 123 | helper = uihelper.BBUIHelper() |
115 | 124 | ||
@@ -125,19 +134,22 @@ def main(server, eventHandler, tf = TerminalFilter): | |||
125 | logger.addHandler(consolelog) | 134 | logger.addHandler(consolelog) |
126 | 135 | ||
127 | try: | 136 | try: |
128 | cmdline = server.runCommand(["getCmdLineAction"]) | 137 | cmdline, error = server.runCommand(["getCmdLineAction"]) |
129 | if not cmdline: | 138 | if error: |
139 | logger.error("Unable to get bitbake commandline arguments: %s" % error) | ||
140 | return 1 | ||
141 | elif not cmdline: | ||
130 | print("Nothing to do. Use 'bitbake world' to build everything, or run 'bitbake --help' for usage information.") | 142 | print("Nothing to do. Use 'bitbake world' to build everything, or run 'bitbake --help' for usage information.") |
131 | return 1 | 143 | return 1 |
132 | elif not cmdline['action']: | 144 | ret, error = server.runCommand(cmdline) |
133 | print(cmdline['msg']) | 145 | if error: |
146 | logger.error("Command '%s' failed: %s" % (cmdline, error)) | ||
134 | return 1 | 147 | return 1 |
135 | ret = server.runCommand(cmdline['action']) | 148 | elif ret != True: |
136 | if ret != True: | 149 | logger.error("Command '%s' failed: returned %s" % (cmdline, ret)) |
137 | print("Couldn't get default commandline! %s" % ret) | ||
138 | return 1 | 150 | return 1 |
139 | except xmlrpclib.Fault as x: | 151 | except xmlrpclib.Fault as x: |
140 | print("XMLRPC Fault getting commandline:\n %s" % x) | 152 | logger.error("XMLRPC Fault getting commandline:\n %s" % x) |
141 | return 1 | 153 | return 1 |
142 | 154 | ||
143 | parseprogress = None | 155 | parseprogress = None |
@@ -318,14 +330,19 @@ def main(server, eventHandler, tf = TerminalFilter): | |||
318 | if ioerror.args[0] == 4: | 330 | if ioerror.args[0] == 4: |
319 | pass | 331 | pass |
320 | except KeyboardInterrupt: | 332 | except KeyboardInterrupt: |
333 | import time | ||
321 | termfilter.clearFooter() | 334 | termfilter.clearFooter() |
322 | if main.shutdown == 1: | 335 | if main.shutdown == 1: |
323 | print("\nSecond Keyboard Interrupt, stopping...\n") | 336 | print("\nSecond Keyboard Interrupt, stopping...\n") |
324 | server.runCommand(["stateStop"]) | 337 | _, error = server.runCommand(["stateStop"]) |
338 | if error: | ||
339 | logger.error("Unable to cleanly stop: %s" % error) | ||
325 | if main.shutdown == 0: | 340 | if main.shutdown == 0: |
326 | interrupted = True | ||
327 | print("\nKeyboard Interrupt, closing down...\n") | 341 | print("\nKeyboard Interrupt, closing down...\n") |
328 | server.runCommand(["stateShutdown"]) | 342 | interrupted = True |
343 | _, error = server.runCommand(["stateShutdown"]) | ||
344 | if error: | ||
345 | logger.error("Unable to cleanly shutdown: %s" % error) | ||
329 | main.shutdown = main.shutdown + 1 | 346 | main.shutdown = main.shutdown + 1 |
330 | pass | 347 | pass |
331 | 348 | ||