@@ -45,6 +45,10 @@ if __name__ == "__main__":
tinfoil.prepare(quiet=2, config_only=True)
d = tinfoil.config_data
+ # Expand keys and run anonymous functions to get identical result to
+ # "bitbake -e"
+ d = tinfoil.finalizeData()
+
value = None
if args.flag:
value = d.getVarFlag(args.variable, args.flag, expand=not args.unexpand)
@@ -24,6 +24,7 @@ import io
import bb.event
import bb.cooker
import bb.remotedata
+import bb.parse
class DataStoreConnectionHandle(object):
def __init__(self, dsindex=0):
@@ -582,6 +583,13 @@ class CommandsSync:
return DataStoreConnectionHandle(idx)
parseRecipeFile.readonly = True
+ def finalizeData(self, command, params):
+ newdata = command.cooker.data.createCopy()
+ bb.data.expandKeys(newdata)
+ bb.parse.ast.runAnonFuncs(newdata)
+ idx = command.remotedatastores.store(newdata)
+ return DataStoreConnectionHandle(idx)
+
class CommandsAsync:
"""
A class of asynchronous commands
@@ -25,6 +25,7 @@ import bb.command
import bb.remotedata
from bb.main import setup_bitbake, BitBakeConfigParameters
import bb.fetch2
+import bb.parse
# We need this in order to shut down the connection to the bitbake server,
@@ -633,6 +634,12 @@ class Tinfoil:
fn = self.get_recipe_file(pn)
return self.parse_recipe_file(fn)
+ def finalizeData(self):
+ """
+ Run anonymous functions and expand keys
+ """
+ return self._reconvert_type(self.run_command('finalizeData'), 'DataStoreConnectionHandle')
+
def parse_recipe_file(self, fn, appends=True, appendlist=None, config_data=None):
"""
Parse the specified recipe file (with or without bbappends)