summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/codeparser.py
diff options
context:
space:
mode:
authorChristopher Larson <chris_larson@mentor.com>2016-04-30 12:52:45 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-19 09:05:21 +0100
commit1fb330bea656617451509433ff93d426d02b8204 (patch)
tree6e418e6e60962454558172332ced856fa8b10a6d /bitbake/lib/bb/codeparser.py
parent32ee30a46d5e27ffcb0f18d85a0768bd22adca94 (diff)
downloadopenembedded-core-contrib-1fb330bea656617451509433ff93d426d02b8204.tar.gz
bitbake: bb.codeparser: track variable flag references
Previously we only tracked the flags (minus excluded) of variables we depend on, but not the flags we use explicitly. (Bitbake rev: bdeb3dcd7c92e62a7c079e7b27048c4114f24a3a) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/codeparser.py')
-rw-r--r--bitbake/lib/bb/codeparser.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/bitbake/lib/bb/codeparser.py b/bitbake/lib/bb/codeparser.py
index 3ee4d5622b..2980510d41 100644
--- a/bitbake/lib/bb/codeparser.py
+++ b/bitbake/lib/bb/codeparser.py
@@ -191,6 +191,7 @@ class BufferedLogger(Logger):
class PythonParser():
getvars = (".getVar", ".appendVar", ".prependVar")
+ getvarflags = (".getVarFlag", ".appendVarFlag", ".prependVarFlag")
containsfuncs = ("bb.utils.contains", "base_contains", "bb.utils.contains_any")
execfuncs = ("bb.build.exec_func", "bb.build.exec_task")
@@ -210,15 +211,20 @@ class PythonParser():
def visit_Call(self, node):
name = self.called_node_name(node.func)
- if name and name.endswith(self.getvars) or name in self.containsfuncs:
+ if name and (name.endswith(self.getvars) or name.endswith(self.getvarflags) or name in self.containsfuncs):
if isinstance(node.args[0], ast.Str):
varname = node.args[0].s
if name in self.containsfuncs and isinstance(node.args[1], ast.Str):
if varname not in self.contains:
self.contains[varname] = set()
self.contains[varname].add(node.args[1].s)
- else:
- self.references.add(node.args[0].s)
+ elif name.endswith(self.getvarflags):
+ if isinstance(node.args[1], ast.Str):
+ self.references.add('%s[%s]' % (varname, node.args[1].s))
+ else:
+ self.warn(node.func, node.args[1])
+ else:
+ self.references.add(varname)
else:
self.warn(node.func, node.args[0])
elif name and name.endswith(".expand"):