From f0930c8d63cc9fd8ead759b3230ab708fffa6ed4 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Mon, 20 May 2013 22:54:41 +0100 Subject: 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 --- bitbake/lib/bb/command.py | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'bitbake/lib/bb/command.py') diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py index 8577df6e0c..29d31d5985 100644 --- a/bitbake/lib/bb/command.py +++ b/bitbake/lib/bb/command.py @@ -143,18 +143,6 @@ class CommandsSync: """ command.cooker.stop() - def getCmdLineAction(self, command, params): - """ - Get any command parsed from the commandline - """ - cmd_action = command.cooker.commandlineAction - if cmd_action is None: - return None - elif 'msg' in cmd_action and cmd_action['msg']: - raise CommandError(cmd_action['msg']) - else: - return cmd_action['action'] - def getVariable(self, command, params): """ Read the value of a variable from configuration.data @@ -174,6 +162,14 @@ class CommandsSync: value = str(params[1]) command.cooker.configuration.data.setVar(varname, value) + def setConfig(self, command, params): + """ + Set the value of variable in configuration + """ + varname = params[0] + value = str(params[1]) + setattr(command.cooker.configuration, varname, value) + def enableDataTracking(self, command, params): """ Enable history tracking for variables -- cgit v1.2.3-54-g00ecf