diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2008-03-16 12:54:01 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2008-03-16 12:54:01 +0000 |
commit | 38ce7b95b9f76afaf1d2fe9b39817411b0b3ba57 (patch) | |
tree | acf0aa202d24e247ba9ff04a8b21db8498309880 /lib/bb/ui/knotty.py | |
parent | 8b25cead6217c458cc6db32b9705ecdf3b2ff66f (diff) | |
download | bitbake-38ce7b95b9f76afaf1d2fe9b39817411b0b3ba57.tar.gz |
Add return value handling (thanks pH5)
Diffstat (limited to 'lib/bb/ui/knotty.py')
-rw-r--r-- | lib/bb/ui/knotty.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/bb/ui/knotty.py b/lib/bb/ui/knotty.py index a549cceb8..12c1b3838 100644 --- a/lib/bb/ui/knotty.py +++ b/lib/bb/ui/knotty.py @@ -39,16 +39,17 @@ def init(frontend, eventHandler): cmdline = frontend.runCommand(["getCmdLineAction"]) #print cmdline if not cmdline: - return + return 1 ret = frontend.runCommand(cmdline) if ret != True: - print "Couldn't get default commandlind! %s" % ret - return + print "Couldn't get default commandline! %s" % ret + return 1 except xmlrpclib.Fault, x: print "XMLRPC Fault getting commandline:\n %s" % x - return + return 1 shutdown = 0 + return_value = 0 while True: try: event = eventHandler.waitEvent(0.25) @@ -71,9 +72,11 @@ def init(frontend, eventHandler): print 'WARNING: ' + event[1]['_message'] continue if event[0].startswith('bb.msg.MsgError'): + return_value = 1 print 'ERROR: ' + event[1]['_message'] continue if event[0].startswith('bb.build.TaskFailed'): + return_value = 1 logfile = event[1]['logfile'] if logfile: print "ERROR: Logfile of failure stored in %s." % logfile @@ -120,6 +123,7 @@ def init(frontend, eventHandler): if event[0] == 'bb.command.CookerCommandCompleted': break if event[0] == 'bb.command.CookerCommandFailed': + return_value = 1 print "Command execution failed: %s" % event[1]['error'] break if event[0] == 'bb.cooker.CookerExit': @@ -150,3 +154,4 @@ def init(frontend, eventHandler): frontend.runCommand(["stateShutdown"]) shutdown = shutdown + 1 pass + return return_value |