diff options
author | Christopher Larson <chris_larson@mentor.com> | 2011-10-28 21:32:26 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-01-30 16:16:12 +0000 |
commit | 2b26745c70a01bbabf5a303fe12a8b3b41071890 (patch) | |
tree | 8e1949e25863c5bf4088146c9d6674d7936344d3 /bitbake/lib/bb/data.py | |
parent | 28ca6cc34b88eaddaa31b25c1d0dd2742c1638dd (diff) | |
download | poky-2b26745c70a01bbabf5a303fe12a8b3b41071890.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 | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py index d5d992934d..5bb2595893 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()): | |||
258 | emit_var(key, o, d, False) and o.write('\n') | 258 | emit_var(key, o, d, False) and o.write('\n') |
259 | 259 | ||
260 | emit_var(func, o, d, False) and o.write('\n') | 260 | emit_var(func, o, d, False) and o.write('\n') |
261 | newdeps = bb.codeparser.ShellParser().parse_shell(d.getVar(func, True)) | 261 | newdeps = bb.codeparser.ShellParser(func).parse_shell(d.getVar(func, True)) |
262 | seen = set() | 262 | seen = set() |
263 | while newdeps: | 263 | while newdeps: |
264 | deps = newdeps | 264 | deps = newdeps |
@@ -267,7 +267,7 @@ def emit_func(func, o=sys.__stdout__, d = init()): | |||
267 | for dep in deps: | 267 | for dep in deps: |
268 | if bb.data.getVarFlag(dep, "func", d): | 268 | if bb.data.getVarFlag(dep, "func", d): |
269 | emit_var(dep, o, d, False) and o.write('\n') | 269 | emit_var(dep, o, d, False) and o.write('\n') |
270 | newdeps |= bb.codeparser.ShellParser().parse_shell(d.getVar(dep, True)) | 270 | newdeps |= bb.codeparser.ShellParser(dep).parse_shell(d.getVar(dep, True)) |
271 | newdeps -= seen | 271 | newdeps -= seen |
272 | 272 | ||
273 | def update_data(d): | 273 | def update_data(d): |