diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2013-09-18 13:15:51 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-09-22 12:19:44 +0100 |
commit | a05d474e5a0688ba80cab75d95e3c057c5db4f97 (patch) | |
tree | 3ae274d2e78e480497b319e9e32268f3fec6159f | |
parent | 0c51d610e1bdb16ec96c29ec2b92de922f67b009 (diff) | |
download | poky-a05d474e5a0688ba80cab75d95e3c057c5db4f97.tar.gz |
bitbake: 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.
(Bitbake rev: 3e094da513e1220319288806cb76ddf804772afd)
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | bitbake/lib/bb/command.py | 9 | ||||
-rw-r--r-- | bitbake/lib/bb/cooker.py | 15 |
2 files changed, 24 insertions, 0 deletions
diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py index f1abaf70d2..21a6de0f62 100644 --- a/bitbake/lib/bb/command.py +++ b/bitbake/lib/bb/command.py | |||
@@ -145,6 +145,15 @@ class CommandsSync: | |||
145 | """ | 145 | """ |
146 | command.cooker.shutdown(True) | 146 | command.cooker.shutdown(True) |
147 | 147 | ||
148 | def getAllKeysWithFlags(self, command, params): | ||
149 | """ | ||
150 | Returns a dump of the global state. Call with | ||
151 | variable flags to be retrieved as params. | ||
152 | """ | ||
153 | flaglist = params[0] | ||
154 | return command.cooker.getAllKeysWithFlags(flaglist) | ||
155 | getAllKeysWithFlags.readonly = True | ||
156 | |||
148 | def getVariable(self, command, params): | 157 | def getVariable(self, command, params): |
149 | """ | 158 | """ |
150 | Read the value of a variable from data | 159 | Read the value of a variable from data |
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index fafa518911..ff2af69069 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -1154,6 +1154,21 @@ class BBCooker: | |||
1154 | 1154 | ||
1155 | self.configuration.server_register_idlecallback(buildTargetsIdle, rq) | 1155 | self.configuration.server_register_idlecallback(buildTargetsIdle, rq) |
1156 | 1156 | ||
1157 | |||
1158 | def getAllKeysWithFlags(self, flaglist): | ||
1159 | dump = {} | ||
1160 | for k in self.data.keys(): | ||
1161 | try: | ||
1162 | v = self.data.getVar(k, True) | ||
1163 | if not k.startswith("__") and not isinstance(v, bb.data_smart.DataSmart): | ||
1164 | dump[k] = { 'v' : v } | ||
1165 | for d in flaglist: | ||
1166 | dump[k][d] = self.data.getVarFlag(k, d) | ||
1167 | except Exception as e: | ||
1168 | print(e) | ||
1169 | return dump | ||
1170 | |||
1171 | |||
1157 | def generateNewImage(self, image, base_image, package_queue, timestamp, description): | 1172 | def generateNewImage(self, image, base_image, package_queue, timestamp, description): |
1158 | ''' | 1173 | ''' |
1159 | Create a new image with a "require"/"inherit" base_image statement | 1174 | Create a new image with a "require"/"inherit" base_image statement |