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: """ 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/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: 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