From acc7b4d931f55477090f4143aed08415010fefca Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Sun, 11 Oct 2015 10:11:47 +0100 Subject: 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 --- bitbake/lib/bb/command.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'bitbake') 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: value = str(params[1]) command.cooker.data.setVar(varname, value) + def getSetVariable(self, command, params): + """ + Read the value of a variable from data and set it into the datastore + which effectively expands and locks the value. + """ + varname = params[0] + result = self.getVariable(command, params) + command.cooker.data.setVar(varname, result) + return result + def setConfig(self, command, params): """ Set the value of variable in configuration -- cgit v1.2.3-54-g00ecf