Openembedded Bitbake Development
 help / color / mirror / Atom feed
* [PATCH] command: Add getSetVariable command
@ 2015-10-11  9:11 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2015-10-11  9:11 UTC (permalink / raw)
  To: bitbake-devel

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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 bitbake/lib/bb/command.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py
index 31aa071..7c980a2 100644
--- a/bitbake/lib/bb/command.py
+++ b/bitbake/lib/bb/command.py
@@ -190,6 +190,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




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-10-11 15:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-11  9:11 [PATCH] command: Add getSetVariable command Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox