diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2016-03-02 22:47:42 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-03-07 17:21:07 +0000 |
commit | d4b5796899c3ca5c7becd7322291afd8afb35a31 (patch) | |
tree | 3c5e7a2f31be855070c44c5743f40153448927ed /lib/bb/ui | |
parent | 6e3f13ffb47102b5df2da91fbc3f5da3179245b2 (diff) | |
download | bitbake-contrib-d4b5796899c3ca5c7becd7322291afd8afb35a31.tar.gz |
toasterui: make toasterui to work in build mode
Currently toasterui works only in observer mode. This is
artificial limitation which was made to support current toaster
design. As we decided to stop using bitbake server we'll
need to run toasterui also in build mode.
[YOCTO #7880]
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/ui')
-rw-r--r-- | lib/bb/ui/toasterui.py | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/bb/ui/toasterui.py b/lib/bb/ui/toasterui.py index fec69621f..2d443776b 100644 --- a/lib/bb/ui/toasterui.py +++ b/lib/bb/ui/toasterui.py @@ -168,8 +168,23 @@ def main(server, eventHandler, params): build_history_enabled = False if not params.observe_only: - logger.error("ToasterUI can only work in observer mode") - return 1 + params.updateFromServer(server) + params.updateToServer(server, os.environ.copy()) + cmdline = params.parseActions() + if not cmdline: + print("Nothing to do. Use 'bitbake world' to build everything, or run 'bitbake --help' for usage information.") + return 1 + if 'msg' in cmdline and cmdline['msg']: + logger.error(cmdline['msg']) + return 1 + + ret, error = server.runCommand(cmdline['action']) + if error: + logger.error("Command '%s' failed: %s" % (cmdline, error)) + return 1 + elif ret != True: + logger.error("Command '%s' failed: returned %s" % (cmdline, ret)) + return 1 # set to 1 when toasterui needs to shut down main.shutdown = 0 |