[gnome-continuous-yocto/gnomeostree-3.28-rocko: 395/8267] bitbake: bb.codeparser: track variable flag references
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous-yocto/gnomeostree-3.28-rocko: 395/8267] bitbake: bb.codeparser: track variable flag references
- Date: Sat, 16 Dec 2017 20:22:00 +0000 (UTC)
commit 1fb330bea656617451509433ff93d426d02b8204
Author: Christopher Larson <chris_larson mentor com>
Date: Sat Apr 30 12:52:45 2016 -0700
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>
bitbake/lib/bb/codeparser.py | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/bitbake/lib/bb/codeparser.py b/bitbake/lib/bb/codeparser.py
index 3ee4d56..2980510 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"):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]