summaryrefslogtreecommitdiffstats
path: root/lib/bb/cooker.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-02 13:59:52 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-10 13:33:48 +0000
commit3f5520b4844a4bdd615046479ba08ed192bdc8cd (patch)
tree13712af7a031ac617bb2932683e7a75db3fe0db4 /lib/bb/cooker.py
parent765a2480dbe288f64562a9611dd93b6b6dd0a64e (diff)
downloadbitbake-contrib-3f5520b4844a4bdd615046479ba08ed192bdc8cd.tar.gz
cooker: Don't expand python functions in variable dumps
We don't want to expand python functions since they aren't expanded at execution time (e.g. anonymous python). They can also have side effects. This function is primarily used by toaster for variable dumps for later display. The lack of expansion of python functions won't matter in this case and actively helps some variable handling (e.g. SRCPV). Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/cooker.py')
-rw-r--r--lib/bb/cooker.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index bc0220760..d990b0587 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -1429,14 +1429,21 @@ class BBCooker:
dump = {}
for k in self.data.keys():
try:
- v = self.data.getVar(k, True)
+ expand = True
+ flags = self.data.getVarFlags(k)
+ if flags and "func" in flags and "python" in flags:
+ expand = False
+ v = self.data.getVar(k, expand)
if not k.startswith("__") and not isinstance(v, bb.data_smart.DataSmart):
dump[k] = {
'v' : v ,
'history' : self.data.varhistory.variable(k),
}
for d in flaglist:
- dump[k][d] = self.data.getVarFlag(k, d)
+ if flags and d in flags:
+ dump[k][d] = flags[d]
+ else:
+ dump[k][d] = None
except Exception as e:
print(e)
return dump