summaryrefslogtreecommitdiffstats
path: root/lib/bb/data.py
diff options
context:
space:
mode:
authorChristopher Larson <chris_larson@mentor.com>2011-10-28 21:32:26 -0400
committerChristopher Larson <chris_larson@mentor.com>2011-11-04 14:57:56 -0400
commit1060193ae4d54e667735dbff5d1d2be49a3f95c9 (patch)
treed5c80f45afc37e808e62e9c1a2d9ca33d8d86b45 /lib/bb/data.py
parent84e535b5165c7e936c5b1486bdf4626ed3649f5f (diff)
downloadbitbake-1060193ae4d54e667735dbff5d1d2be49a3f95c9.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 Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Diffstat (limited to 'lib/bb/data.py')
-rw-r--r--lib/bb/data.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/bb/data.py b/lib/bb/data.py
index ac0d8809c..bcb8b055b 100644
--- a/lib/bb/data.py
+++ b/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