diff options
-rw-r--r-- | bitbake/lib/bb/codeparser.py | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/bitbake/lib/bb/codeparser.py b/bitbake/lib/bb/codeparser.py index 7d40835cb8..ba3009212b 100644 --- a/bitbake/lib/bb/codeparser.py +++ b/bitbake/lib/bb/codeparser.py | |||
@@ -4,7 +4,7 @@ from bb import msg, utils | |||
4 | import ast | 4 | import ast |
5 | import codegen | 5 | import codegen |
6 | 6 | ||
7 | PARSERCACHE_VERSION = 1 | 7 | PARSERCACHE_VERSION = 2 |
8 | 8 | ||
9 | try: | 9 | try: |
10 | import cPickle as pickle | 10 | import cPickle as pickle |
@@ -177,11 +177,11 @@ class PythonParser(): | |||
177 | 177 | ||
178 | def parse_python(self, node): | 178 | def parse_python(self, node): |
179 | 179 | ||
180 | h = hash(node) | 180 | h = hash(str(node)) |
181 | 181 | ||
182 | if h in pythonparsecache: | 182 | if h in pythonparsecache: |
183 | self.references = pythonparsecache[h].references | 183 | self.references = pythonparsecache[h]["refs"] |
184 | self.execs = pythonparsecache[h].execs | 184 | self.execs = pythonparsecache[h]["execs"] |
185 | return | 185 | return |
186 | 186 | ||
187 | code = compile(check_indent(str(node)), "<string>", "exec", | 187 | code = compile(check_indent(str(node)), "<string>", "exec", |
@@ -196,7 +196,9 @@ class PythonParser(): | |||
196 | self.references.update(visitor.var_execs) | 196 | self.references.update(visitor.var_execs) |
197 | self.execs = visitor.direct_func_calls | 197 | self.execs = visitor.direct_func_calls |
198 | 198 | ||
199 | pythonparsecache[h] = self | 199 | pythonparsecache[h] = {} |
200 | pythonparsecache[h]["refs"] = self.references | ||
201 | pythonparsecache[h]["execs"] = self.execs | ||
200 | 202 | ||
201 | class ShellParser(): | 203 | class ShellParser(): |
202 | def __init__(self): | 204 | def __init__(self): |
@@ -209,10 +211,10 @@ class ShellParser(): | |||
209 | commands it executes. | 211 | commands it executes. |
210 | """ | 212 | """ |
211 | 213 | ||
212 | h = hash(value) | 214 | h = hash(str(value)) |
213 | 215 | ||
214 | if h in shellparsecache: | 216 | if h in shellparsecache: |
215 | self.execs = shellparsecache[h].execs | 217 | self.execs = shellparsecache[h]["execs"] |
216 | return self.execs | 218 | return self.execs |
217 | 219 | ||
218 | try: | 220 | try: |
@@ -224,7 +226,8 @@ class ShellParser(): | |||
224 | self.process_tokens(token) | 226 | self.process_tokens(token) |
225 | self.execs = set(cmd for cmd in self.allexecs if cmd not in self.funcdefs) | 227 | self.execs = set(cmd for cmd in self.allexecs if cmd not in self.funcdefs) |
226 | 228 | ||
227 | shellparsecache[h] = self | 229 | shellparsecache[h] = {} |
230 | shellparsecache[h]["execs"] = self.execs | ||
228 | 231 | ||
229 | return self.execs | 232 | return self.execs |
230 | 233 | ||