diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-05-03 11:15:37 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-07-03 13:47:18 +0100 |
commit | 8e05d5e3fe04face623c4f9fb08b12f13c22edab (patch) | |
tree | ce35dde3e8395863fb2cf6e0a7d7d98391b949fa | |
parent | 5c1f10f56ef6e778c2d6b23184899d6e7c0edfaf (diff) | |
download | poky-8e05d5e3fe04face623c4f9fb08b12f13c22edab.tar.gz |
bitbake: codeparser: Fix to better catch all getVar references
Currently if you do localdata.getVar, the code parser simply ignores
the references. Change the code to use endswith() to catch more of the
references. These names are probably unique enough to get away with this.
Bump the cache version to ensure things get updated.
(Bitbake rev: 8e386a710023e000a504e05c13da0106df0c7f3a)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | bitbake/lib/bb/codeparser.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bitbake/lib/bb/codeparser.py b/bitbake/lib/bb/codeparser.py index de8d2eb08d..6d812560a3 100644 --- a/bitbake/lib/bb/codeparser.py +++ b/bitbake/lib/bb/codeparser.py | |||
@@ -35,7 +35,7 @@ def check_indent(codestr): | |||
35 | 35 | ||
36 | class CodeParserCache(MultiProcessCache): | 36 | class CodeParserCache(MultiProcessCache): |
37 | cache_file_name = "bb_codeparser.dat" | 37 | cache_file_name = "bb_codeparser.dat" |
38 | CACHE_VERSION = 5 | 38 | CACHE_VERSION = 6 |
39 | 39 | ||
40 | def __init__(self): | 40 | def __init__(self): |
41 | MultiProcessCache.__init__(self) | 41 | MultiProcessCache.__init__(self) |
@@ -102,7 +102,7 @@ class BufferedLogger(Logger): | |||
102 | self.buffer = [] | 102 | self.buffer = [] |
103 | 103 | ||
104 | class PythonParser(): | 104 | class PythonParser(): |
105 | getvars = ("d.getVar", "bb.data.getVar", "data.getVar", "d.appendVar", "d.prependVar") | 105 | getvars = (".getVar", ".appendVar", ".prependVar") |
106 | containsfuncs = ("bb.utils.contains", "base_contains", "oe.utils.contains") | 106 | containsfuncs = ("bb.utils.contains", "base_contains", "oe.utils.contains") |
107 | execfuncs = ("bb.build.exec_func", "bb.build.exec_task") | 107 | execfuncs = ("bb.build.exec_func", "bb.build.exec_task") |
108 | 108 | ||
@@ -122,7 +122,7 @@ class PythonParser(): | |||
122 | 122 | ||
123 | def visit_Call(self, node): | 123 | def visit_Call(self, node): |
124 | name = self.called_node_name(node.func) | 124 | name = self.called_node_name(node.func) |
125 | if name in self.getvars or name in self.containsfuncs: | 125 | if name and name.endswith(self.getvars) or name in self.containsfuncs: |
126 | if isinstance(node.args[0], ast.Str): | 126 | if isinstance(node.args[0], ast.Str): |
127 | varname = node.args[0].s | 127 | varname = node.args[0].s |
128 | if name in self.containsfuncs and isinstance(node.args[1], ast.Str): | 128 | if name in self.containsfuncs and isinstance(node.args[1], ast.Str): |