summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/command.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/command.py')
-rw-r--r--bitbake/lib/bb/command.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py
index 06bd203c90..9a8d689e2a 100644
--- a/bitbake/lib/bb/command.py
+++ b/bitbake/lib/bb/command.py
@@ -20,7 +20,7 @@ Provide an interface to interact with the bitbake server through 'commands'
20# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 20# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 21
22""" 22"""
23The bitbake server takes 'commands' from its UI/commandline. 23The bitbake server takes 'commands' from its UI/commandline.
24Commands are either synchronous or asynchronous. 24Commands are either synchronous or asynchronous.
25Async commands return data to the client in the form of events. 25Async commands return data to the client in the form of events.
26Sync commands must only return data through the function return value 26Sync commands must only return data through the function return value
@@ -62,7 +62,7 @@ class Command:
62 try: 62 try:
63 command = commandline.pop(0) 63 command = commandline.pop(0)
64 if command in CommandsSync.__dict__: 64 if command in CommandsSync.__dict__:
65 # Can run synchronous commands straight away 65 # Can run synchronous commands straight away
66 return getattr(CommandsSync, command)(self.cmds_sync, self, commandline) 66 return getattr(CommandsSync, command)(self.cmds_sync, self, commandline)
67 if self.currentAsyncCommand is not None: 67 if self.currentAsyncCommand is not None:
68 return "Busy (%s in progress)" % self.currentAsyncCommand[0] 68 return "Busy (%s in progress)" % self.currentAsyncCommand[0]
@@ -89,7 +89,17 @@ class Command:
89 return False 89 return False
90 else: 90 else:
91 return False 91 return False
92 except: 92 except KeyboardInterrupt as exc:
93 self.finishAsyncCommand("Interrupted")
94 return False
95 except SystemExit as exc:
96 arg = exc.args[0]
97 if isinstance(arg, basestring):
98 self.finishAsyncCommand(arg)
99 else:
100 self.finishAsyncCommand("Exited with %s" % arg)
101 return False
102 except Exception:
93 import traceback 103 import traceback
94 self.finishAsyncCommand(traceback.format_exc()) 104 self.finishAsyncCommand(traceback.format_exc())
95 return False 105 return False
@@ -268,6 +278,3 @@ class CookerCommandSetExitCode(bb.event.Event):
268 def __init__(self, exitcode): 278 def __init__(self, exitcode):
269 bb.event.Event.__init__(self) 279 bb.event.Event.__init__(self)
270 self.exitcode = int(exitcode) 280 self.exitcode = int(exitcode)
271
272
273