diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-05-20 22:54:41 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-05-22 12:10:13 +0100 |
commit | f0930c8d63cc9fd8ead759b3230ab708fffa6ed4 (patch) | |
tree | d589dce4ac5f1fb34ee6d21fc9889a9d6a48b81d /bitbake/lib/bb/ui/ncurses.py | |
parent | f242f5060bbc62815b6d5a245c1a9bf18f23675f (diff) | |
download | poky-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/ncurses.py')
-rw-r--r-- | bitbake/lib/bb/ui/ncurses.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/bitbake/lib/bb/ui/ncurses.py b/bitbake/lib/bb/ui/ncurses.py index 98647fc3e0..c45ffd63ac 100644 --- a/bitbake/lib/bb/ui/ncurses.py +++ b/bitbake/lib/bb/ui/ncurses.py | |||
@@ -196,7 +196,7 @@ class NCursesUI: | |||
196 | # t.start() | 196 | # t.start() |
197 | 197 | ||
198 | #-------------------------------------------------------------------------# | 198 | #-------------------------------------------------------------------------# |
199 | def main(self, stdscr, server, eventHandler): | 199 | def main(self, stdscr, server, eventHandler, params): |
200 | #-------------------------------------------------------------------------# | 200 | #-------------------------------------------------------------------------# |
201 | height, width = stdscr.getmaxyx() | 201 | height, width = stdscr.getmaxyx() |
202 | 202 | ||
@@ -236,13 +236,15 @@ class NCursesUI: | |||
236 | shutdown = 0 | 236 | shutdown = 0 |
237 | 237 | ||
238 | try: | 238 | try: |
239 | cmdline, error = server.runCommand(["getCmdLineAction"]) | 239 | params.updateFromServer(server) |
240 | cmdline = params.parseActions() | ||
240 | if not cmdline: | 241 | if not cmdline: |
241 | print("Nothing to do. Use 'bitbake world' to build everything, or run 'bitbake --help' for usage information.") | 242 | print("Nothing to do. Use 'bitbake world' to build everything, or run 'bitbake --help' for usage information.") |
242 | return | 243 | return 1 |
243 | elif error: | 244 | if 'msg' in cmdline and cmdline['msg']: |
244 | print("Error getting bitbake commandline: %s" % error) | 245 | logger.error(cmdline['msg']) |
245 | return | 246 | return 1 |
247 | cmdline = cmdline['action'] | ||
246 | ret, error = server.runCommand(cmdline) | 248 | ret, error = server.runCommand(cmdline) |
247 | if error: | 249 | if error: |
248 | print("Error running command '%s': %s" % (cmdline, error)) | 250 | print("Error running command '%s': %s" % (cmdline, error)) |