summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui/goggle.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-20 22:54:41 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-22 12:10:13 +0100
commitf0930c8d63cc9fd8ead759b3230ab708fffa6ed4 (patch)
treed589dce4ac5f1fb34ee6d21fc9889a9d6a48b81d /bitbake/lib/bb/ui/goggle.py
parentf242f5060bbc62815b6d5a245c1a9bf18f23675f (diff)
downloadpoky-f0930c8d63cc9fd8ead759b3230ab708fffa6ed4.tar.gz
bitbake: cooker: Move commandline parsing back into the UI/cookerdata
Building up a set of actions for the server is tricky since we depend upon the commandline but fall back to values from the datastore. We should be able to build a datastore without a commandline and vice versa. Ultimately the UI should send the commands to the server. This patch amounts to code rearranging, moving the heavy lifting to the UI, though a helper in the configuration option. This will need further cleanup/tweaking but this should be the only update needed to the UIs. The code now queries the server for any missing data should it need to. This code allows various knowledge of configuration variables to move to the UI side only, partcularly pkgs_to_build but also all the command specifiers. It should also be possible to move cmd eventually, I'm just unsure if any callers call the commands expecting this to default to something sane right now. (Bitbake rev: 2dbbb1d51dafd4451fef8fe16f095bcd4b8f1177) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui/goggle.py')
-rw-r--r--bitbake/lib/bb/ui/goggle.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/bitbake/lib/bb/ui/goggle.py b/bitbake/lib/bb/ui/goggle.py
index e8a54ab295..16faba4c21 100644
--- a/bitbake/lib/bb/ui/goggle.py
+++ b/bitbake/lib/bb/ui/goggle.py
@@ -63,7 +63,7 @@ class MainWindow (gtk.Window):
63 scrolled_window.add (self.cur_build_tv) 63 scrolled_window.add (self.cur_build_tv)
64 64
65 65
66def main (server, eventHandler): 66def main (server, eventHandler, params):
67 gobject.threads_init() 67 gobject.threads_init()
68 gtk.gdk.threads_init() 68 gtk.gdk.threads_init()
69 69
@@ -80,13 +80,15 @@ def main (server, eventHandler):
80 running_build.connect ("build-failed", running_build_failed_cb) 80 running_build.connect ("build-failed", running_build_failed_cb)
81 81
82 try: 82 try:
83 cmdline, error = server.runCommand(["getCmdLineAction"]) 83 params.updateFromServer(server)
84 if error: 84 cmdline = params.parseActions()
85 print("Error getting bitbake commandline: %s" % error) 85 if not cmdline:
86 return 1
87 elif not cmdline:
88 print("Nothing to do. Use 'bitbake world' to build everything, or run 'bitbake --help' for usage information.") 86 print("Nothing to do. Use 'bitbake world' to build everything, or run 'bitbake --help' for usage information.")
89 return 1 87 return 1
88 if 'msg' in cmdline and cmdline['msg']:
89 logger.error(cmdline['msg'])
90 return 1
91 cmdline = cmdline['action']
90 ret, error = server.runCommand(cmdline) 92 ret, error = server.runCommand(cmdline)
91 if error: 93 if error:
92 print("Error running command '%s': %s" % (cmdline, error)) 94 print("Error running command '%s': %s" % (cmdline, error))