summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-11 10:11:47 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-29 07:35:51 +0000
commitacc7b4d931f55477090f4143aed08415010fefca (patch)
treed2470fa41f3fb72da600e7da676602036cafe51a /bitbake
parentc8051c52a4e1a127a324c4564c6b8f54da685e3a (diff)
downloadpoky-acc7b4d931f55477090f4143aed08415010fefca.tar.gz
bitbake: command: Add getSetVariable command
There are some use cases where we want to read a variable but also set the variable to the value read, effectively locking in any expansion of it. This adds such a command. (Bitbake rev: 0c0c524691e3d2ffd9953a106fcc06262cbde910) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/command.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py
index 398c1d6a6e..74106d1434 100644
--- a/bitbake/lib/bb/command.py
+++ b/bitbake/lib/bb/command.py
@@ -181,6 +181,16 @@ class CommandsSync:
181 value = str(params[1]) 181 value = str(params[1])
182 command.cooker.data.setVar(varname, value) 182 command.cooker.data.setVar(varname, value)
183 183
184 def getSetVariable(self, command, params):
185 """
186 Read the value of a variable from data and set it into the datastore
187 which effectively expands and locks the value.
188 """
189 varname = params[0]
190 result = self.getVariable(command, params)
191 command.cooker.data.setVar(varname, result)
192 return result
193
184 def setConfig(self, command, params): 194 def setConfig(self, command, params):
185 """ 195 """
186 Set the value of variable in configuration 196 Set the value of variable in configuration