diff options
author | Christopher Larson <chris_larson@mentor.com> | 2011-10-28 21:32:26 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-11-10 11:44:29 +0000 |
commit | ae96ac11897c1017aea359a8e3325291bc198293 (patch) | |
tree | 60ea01a4a0b04ee64c5eda99f5f1759f115dd4a6 /bitbake/lib/bb/data.py | |
parent | 48d7f5251bd5f3a44f713edfc297851258c57120 (diff) | |
download | ast2050-yocto-poky-ae96ac11897c1017aea359a8e3325291bc198293.zip ast2050-yocto-poky-ae96ac11897c1017aea359a8e3325291bc198293.tar.gz |
codeparser: accept a name for better messages
- If a name is passed to the parser, prepend the messages with "while
parsing <name>:". This gives a bit more context.
- Tweak the warning messages slightly (they had to be altered anyway to
inject the variable being parsed).
Before:
DEBUG: Warning: in call to 'bb.data.getVar': argument ''%s' % var' is \
not a literal
After:
DEBUG: while parsing emit_pkgdata, in call of bb.data.getVar, argument \
''%s' % var' is not a string literal
(Bitbake rev: 1060193ae4d54e667735dbff5d1d2be49a3f95c9)
Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/data.py')
-rw-r--r-- | bitbake/lib/bb/data.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py index ac0d880..bcb8b05 100644 --- a/bitbake/lib/bb/data.py +++ b/bitbake/lib/bb/data.py @@ -258,7 +258,7 @@ def emit_func(func, o=sys.__stdout__, d = init()): emit_var(key, o, d, False) and o.write('\n') emit_var(func, o, d, False) and o.write('\n') - newdeps = bb.codeparser.ShellParser().parse_shell(d.getVar(func, True)) + newdeps = bb.codeparser.ShellParser(func).parse_shell(d.getVar(func, True)) seen = set() while newdeps: deps = newdeps @@ -267,7 +267,7 @@ def emit_func(func, o=sys.__stdout__, d = init()): for dep in deps: if bb.data.getVarFlag(dep, "func", d): emit_var(dep, o, d, False) and o.write('\n') - newdeps |= bb.codeparser.ShellParser().parse_shell(d.getVar(dep, True)) + newdeps |= bb.codeparser.ShellParser(dep).parse_shell(d.getVar(dep, True)) newdeps -= seen def update_data(d): @@ -280,12 +280,12 @@ def build_dependencies(key, keys, shelldeps, d): if d.getVarFlag(key, "func"): if d.getVarFlag(key, "python"): parsedvar = d.expandWithRefs(d.getVar(key, False), key) - parser = bb.codeparser.PythonParser() + parser = bb.codeparser.PythonParser(key) parser.parse_python(parsedvar.value) deps = deps | parser.references else: parsedvar = d.expandWithRefs(d.getVar(key, False), key) - parser = bb.codeparser.ShellParser() + parser = bb.codeparser.ShellParser(key) parser.parse_shell(parsedvar.value) deps = deps | shelldeps deps = deps | parsedvar.references |