diff options
Diffstat (limited to 'bitbake/lib/bb/codeparser.py')
| -rw-r--r-- | bitbake/lib/bb/codeparser.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/bitbake/lib/bb/codeparser.py b/bitbake/lib/bb/codeparser.py index 0cec452c00..3b3c3b41ff 100644 --- a/bitbake/lib/bb/codeparser.py +++ b/bitbake/lib/bb/codeparser.py | |||
| @@ -195,6 +195,10 @@ class BufferedLogger(Logger): | |||
| 195 | self.target.handle(record) | 195 | self.target.handle(record) |
| 196 | self.buffer = [] | 196 | self.buffer = [] |
| 197 | 197 | ||
| 198 | class DummyLogger(): | ||
| 199 | def flush(self): | ||
| 200 | return | ||
| 201 | |||
| 198 | class PythonParser(): | 202 | class PythonParser(): |
| 199 | getvars = (".getVar", ".appendVar", ".prependVar", "oe.utils.conditional") | 203 | getvars = (".getVar", ".appendVar", ".prependVar", "oe.utils.conditional") |
| 200 | getvarflags = (".getVarFlag", ".appendVarFlag", ".prependVarFlag") | 204 | getvarflags = (".getVarFlag", ".appendVarFlag", ".prependVarFlag") |
| @@ -276,7 +280,9 @@ class PythonParser(): | |||
| 276 | self.contains = {} | 280 | self.contains = {} |
| 277 | self.execs = set() | 281 | self.execs = set() |
| 278 | self.references = set() | 282 | self.references = set() |
| 279 | self.log = BufferedLogger('BitBake.Data.PythonParser', logging.DEBUG, log) | 283 | self._log = log |
| 284 | # Defer init as expensive | ||
| 285 | self.log = DummyLogger() | ||
| 280 | 286 | ||
| 281 | self.unhandled_message = "in call of %s, argument '%s' is not a string literal" | 287 | self.unhandled_message = "in call of %s, argument '%s' is not a string literal" |
| 282 | self.unhandled_message = "while parsing %s, %s" % (name, self.unhandled_message) | 288 | self.unhandled_message = "while parsing %s, %s" % (name, self.unhandled_message) |
| @@ -303,6 +309,9 @@ class PythonParser(): | |||
| 303 | self.contains[i] = set(codeparsercache.pythoncacheextras[h].contains[i]) | 309 | self.contains[i] = set(codeparsercache.pythoncacheextras[h].contains[i]) |
| 304 | return | 310 | return |
| 305 | 311 | ||
| 312 | # Need to parse so take the hit on the real log buffer | ||
| 313 | self.log = BufferedLogger('BitBake.Data.PythonParser', logging.DEBUG, self._log) | ||
| 314 | |||
| 306 | # We can't add to the linenumbers for compile, we can pad to the correct number of blank lines though | 315 | # We can't add to the linenumbers for compile, we can pad to the correct number of blank lines though |
| 307 | node = "\n" * int(lineno) + node | 316 | node = "\n" * int(lineno) + node |
| 308 | code = compile(check_indent(str(node)), filename, "exec", | 317 | code = compile(check_indent(str(node)), filename, "exec", |
| @@ -321,7 +330,11 @@ class ShellParser(): | |||
| 321 | self.funcdefs = set() | 330 | self.funcdefs = set() |
| 322 | self.allexecs = set() | 331 | self.allexecs = set() |
| 323 | self.execs = set() | 332 | self.execs = set() |
| 324 | self.log = BufferedLogger('BitBake.Data.%s' % name, logging.DEBUG, log) | 333 | self._name = name |
| 334 | self._log = log | ||
| 335 | # Defer init as expensive | ||
| 336 | self.log = DummyLogger() | ||
| 337 | |||
| 325 | self.unhandled_template = "unable to handle non-literal command '%s'" | 338 | self.unhandled_template = "unable to handle non-literal command '%s'" |
| 326 | self.unhandled_template = "while parsing %s, %s" % (name, self.unhandled_template) | 339 | self.unhandled_template = "while parsing %s, %s" % (name, self.unhandled_template) |
| 327 | 340 | ||
| @@ -340,6 +353,9 @@ class ShellParser(): | |||
| 340 | self.execs = set(codeparsercache.shellcacheextras[h].execs) | 353 | self.execs = set(codeparsercache.shellcacheextras[h].execs) |
| 341 | return self.execs | 354 | return self.execs |
| 342 | 355 | ||
| 356 | # Need to parse so take the hit on the real log buffer | ||
| 357 | self.log = BufferedLogger('BitBake.Data.%s' % self._name, logging.DEBUG, self._log) | ||
| 358 | |||
| 343 | self._parse_shell(value) | 359 | self._parse_shell(value) |
| 344 | self.execs = set(cmd for cmd in self.allexecs if cmd not in self.funcdefs) | 360 | self.execs = set(cmd for cmd in self.allexecs if cmd not in self.funcdefs) |
| 345 | 361 | ||
