diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-02-02 13:58:17 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-02-10 15:47:11 +0000 |
commit | f652b6b9d0db96d0fa2d2f1c732263140633d15f (patch) | |
tree | 1bf8485fdd749cd21e86e3c5624355218545e4d3 /bitbake | |
parent | d3e0c448eadf252c1b4e155291a24a12b2912656 (diff) | |
download | poky-f652b6b9d0db96d0fa2d2f1c732263140633d15f.tar.gz |
bitbake: data: Don't expand python functions for variable dependencies
Expanding python functions for variable dependencies doesn't really make sense,
not least since this causes execution of any inline python, it also makes it
impossible to write expressions like d.expand("${X}") of d.setVar("X", "${Y}")
which may have the wrong values if expanded now.
This starts to standardise the approach across bitbake for handling python code.
(Bitbake rev: 765a2480dbe288f64562a9611dd93b6b6dd0a64e)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/data.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py index 44f817e6c8..137ed4e3ee 100644 --- a/bitbake/lib/bb/data.py +++ b/bitbake/lib/bb/data.py | |||
@@ -362,27 +362,27 @@ def build_dependencies(key, keys, shelldeps, varflagsexcl, d): | |||
362 | value = varflags.get("vardepvalue") | 362 | value = varflags.get("vardepvalue") |
363 | elif varflags.get("func"): | 363 | elif varflags.get("func"): |
364 | if varflags.get("python"): | 364 | if varflags.get("python"): |
365 | parsedvar = d.expandWithRefs(value, key) | ||
366 | parser = bb.codeparser.PythonParser(key, logger) | 365 | parser = bb.codeparser.PythonParser(key, logger) |
367 | if parsedvar.value and "\t" in parsedvar.value: | 366 | if value and "\t" in value: |
368 | logger.warn("Variable %s contains tabs, please remove these (%s)" % (key, d.getVar("FILE", True))) | 367 | logger.warn("Variable %s contains tabs, please remove these (%s)" % (key, d.getVar("FILE", True))) |
369 | parser.parse_python(parsedvar.value, filename=varflags.get("filename"), lineno=varflags.get("lineno")) | 368 | parser.parse_python(value, filename=varflags.get("filename"), lineno=varflags.get("lineno")) |
370 | deps = deps | parser.references | 369 | deps = deps | parser.references |
370 | deps = deps | (keys & parser.execs) | ||
371 | value = handle_contains(value, parser.contains, d) | 371 | value = handle_contains(value, parser.contains, d) |
372 | else: | 372 | else: |
373 | parsedvar = d.expandWithRefs(value, key) | 373 | parsedvar = d.expandWithRefs(value, key) |
374 | parser = bb.codeparser.ShellParser(key, logger) | 374 | parser = bb.codeparser.ShellParser(key, logger) |
375 | parser.parse_shell(parsedvar.value) | 375 | parser.parse_shell(parsedvar.value) |
376 | deps = deps | shelldeps | 376 | deps = deps | shelldeps |
377 | deps = deps | parsedvar.references | ||
378 | deps = deps | (keys & parser.execs) | (keys & parsedvar.execs) | ||
379 | value = handle_contains(value, parsedvar.contains, d) | ||
377 | if vardeps is None: | 380 | if vardeps is None: |
378 | parser.log.flush() | 381 | parser.log.flush() |
379 | if "prefuncs" in varflags: | 382 | if "prefuncs" in varflags: |
380 | deps = deps | set(varflags["prefuncs"].split()) | 383 | deps = deps | set(varflags["prefuncs"].split()) |
381 | if "postfuncs" in varflags: | 384 | if "postfuncs" in varflags: |
382 | deps = deps | set(varflags["postfuncs"].split()) | 385 | deps = deps | set(varflags["postfuncs"].split()) |
383 | deps = deps | parsedvar.references | ||
384 | deps = deps | (keys & parser.execs) | (keys & parsedvar.execs) | ||
385 | value = handle_contains(value, parsedvar.contains, d) | ||
386 | else: | 386 | else: |
387 | parser = d.expandWithRefs(value, key) | 387 | parser = d.expandWithRefs(value, key) |
388 | deps |= parser.references | 388 | deps |= parser.references |