summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/codeparser.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/codeparser.py')
-rw-r--r--bitbake/lib/bb/codeparser.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/bitbake/lib/bb/codeparser.py b/bitbake/lib/bb/codeparser.py
index 89d24ab49a..f76b478a47 100644
--- a/bitbake/lib/bb/codeparser.py
+++ b/bitbake/lib/bb/codeparser.py
@@ -117,7 +117,7 @@ class shellCacheLine(object):
117 117
118class CodeParserCache(MultiProcessCache): 118class CodeParserCache(MultiProcessCache):
119 cache_file_name = "bb_codeparser.dat" 119 cache_file_name = "bb_codeparser.dat"
120 CACHE_VERSION = 8 120 CACHE_VERSION = 9
121 121
122 def __init__(self): 122 def __init__(self):
123 MultiProcessCache.__init__(self) 123 MultiProcessCache.__init__(self)
@@ -193,7 +193,8 @@ class BufferedLogger(Logger):
193class PythonParser(): 193class PythonParser():
194 getvars = (".getVar", ".appendVar", ".prependVar") 194 getvars = (".getVar", ".appendVar", ".prependVar")
195 getvarflags = (".getVarFlag", ".appendVarFlag", ".prependVarFlag") 195 getvarflags = (".getVarFlag", ".appendVarFlag", ".prependVarFlag")
196 containsfuncs = ("bb.utils.contains", "base_contains", "bb.utils.contains_any") 196 containsfuncs = ("bb.utils.contains", "base_contains")
197 containsanyfuncs = ("bb.utils.contains_any", "bb.utils.filter")
197 execfuncs = ("bb.build.exec_func", "bb.build.exec_task") 198 execfuncs = ("bb.build.exec_func", "bb.build.exec_task")
198 199
199 def warn(self, func, arg): 200 def warn(self, func, arg):
@@ -212,13 +213,17 @@ class PythonParser():
212 213
213 def visit_Call(self, node): 214 def visit_Call(self, node):
214 name = self.called_node_name(node.func) 215 name = self.called_node_name(node.func)
215 if name and (name.endswith(self.getvars) or name.endswith(self.getvarflags) or name in self.containsfuncs): 216 if name and (name.endswith(self.getvars) or name.endswith(self.getvarflags) or name in self.containsfuncs or name in self.containsanyfuncs):
216 if isinstance(node.args[0], ast.Str): 217 if isinstance(node.args[0], ast.Str):
217 varname = node.args[0].s 218 varname = node.args[0].s
218 if name in self.containsfuncs and isinstance(node.args[1], ast.Str): 219 if name in self.containsfuncs and isinstance(node.args[1], ast.Str):
219 if varname not in self.contains: 220 if varname not in self.contains:
220 self.contains[varname] = set() 221 self.contains[varname] = set()
221 self.contains[varname].add(node.args[1].s) 222 self.contains[varname].add(node.args[1].s)
223 elif name in self.containsanyfuncs and isinstance(node.args[1], ast.Str):
224 if varname not in self.contains:
225 self.contains[varname] = set()
226 self.contains[varname].update(node.args[1].s.split())
222 elif name.endswith(self.getvarflags): 227 elif name.endswith(self.getvarflags):
223 if isinstance(node.args[1], ast.Str): 228 if isinstance(node.args[1], ast.Str):
224 self.references.add('%s[%s]' % (varname, node.args[1].s)) 229 self.references.add('%s[%s]' % (varname, node.args[1].s))