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/command.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/command.py')
-rw-r--r-- | bitbake/lib/bb/command.py | 20 |
1 files changed, 8 insertions, 12 deletions
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: | |||
143 | """ | 143 | """ |
144 | command.cooker.stop() | 144 | command.cooker.stop() |
145 | 145 | ||
146 | def getCmdLineAction(self, command, params): | ||
147 | """ | ||
148 | Get any command parsed from the commandline | ||
149 | """ | ||
150 | cmd_action = command.cooker.commandlineAction | ||
151 | if cmd_action is None: | ||
152 | return None | ||
153 | elif 'msg' in cmd_action and cmd_action['msg']: | ||
154 | raise CommandError(cmd_action['msg']) | ||
155 | else: | ||
156 | return cmd_action['action'] | ||
157 | |||
158 | def getVariable(self, command, params): | 146 | def getVariable(self, command, params): |
159 | """ | 147 | """ |
160 | Read the value of a variable from configuration.data | 148 | Read the value of a variable from configuration.data |
@@ -174,6 +162,14 @@ class CommandsSync: | |||
174 | value = str(params[1]) | 162 | value = str(params[1]) |
175 | command.cooker.configuration.data.setVar(varname, value) | 163 | command.cooker.configuration.data.setVar(varname, value) |
176 | 164 | ||
165 | def setConfig(self, command, params): | ||
166 | """ | ||
167 | Set the value of variable in configuration | ||
168 | """ | ||
169 | varname = params[0] | ||
170 | value = str(params[1]) | ||
171 | setattr(command.cooker.configuration, varname, value) | ||
172 | |||
177 | def enableDataTracking(self, command, params): | 173 | def enableDataTracking(self, command, params): |
178 | """ | 174 | """ |
179 | Enable history tracking for variables | 175 | Enable history tracking for variables |