summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2013-09-18 13:15:51 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-09-18 15:14:13 +0100
commit3e094da513e1220319288806cb76ddf804772afd (patch)
tree79764c1fc9fd16fc69828f679c1dc50b7a117285
parent47c171005fb3803d936e65fcd4436c643883ae16 (diff)
downloadbitbake-3e094da513e1220319288806cb76ddf804772afd.tar.gz
bitbake: cooker, command: add a command to return global data
Adding the 'getAllKeysWithFlags' read-only command that will return a dump of the global data state, together with specified flags for each key. The flag list is passed in as the first parameter to the command. This will be used by UI clients to get the build configuration. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/command.py9
-rw-r--r--lib/bb/cooker.py15
2 files changed, 24 insertions, 0 deletions
diff --git a/lib/bb/command.py b/lib/bb/command.py
index f1abaf70d..21a6de0f6 100644
--- a/lib/bb/command.py
+++ b/lib/bb/command.py
@@ -145,6 +145,15 @@ class CommandsSync:
"""
command.cooker.shutdown(True)
+ def getAllKeysWithFlags(self, command, params):
+ """
+ Returns a dump of the global state. Call with
+ variable flags to be retrieved as params.
+ """
+ flaglist = params[0]
+ return command.cooker.getAllKeysWithFlags(flaglist)
+ getAllKeysWithFlags.readonly = True
+
def getVariable(self, command, params):
"""
Read the value of a variable from data
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index fafa51891..ff2af6906 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -1154,6 +1154,21 @@ class BBCooker:
self.configuration.server_register_idlecallback(buildTargetsIdle, rq)
+
+ def getAllKeysWithFlags(self, flaglist):
+ dump = {}
+ for k in self.data.keys():
+ try:
+ v = self.data.getVar(k, True)
+ if not k.startswith("__") and not isinstance(v, bb.data_smart.DataSmart):
+ dump[k] = { 'v' : v }
+ for d in flaglist:
+ dump[k][d] = self.data.getVarFlag(k, d)
+ except Exception as e:
+ print(e)
+ return dump
+
+
def generateNewImage(self, image, base_image, package_queue, timestamp, description):
'''
Create a new image with a "require"/"inherit" base_image statement