diff options
-rw-r--r-- | bitbake/lib/bb/data.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py index b0683c5180..97022853ca 100644 --- a/bitbake/lib/bb/data.py +++ b/bitbake/lib/bb/data.py | |||
@@ -161,6 +161,12 @@ def emit_var(var, o=sys.__stdout__, d = init(), all=False): | |||
161 | return True | 161 | return True |
162 | 162 | ||
163 | if func: | 163 | if func: |
164 | # Write a comment indicating where the shell function came from (line number and filename) to make it easier | ||
165 | # for the user to diagnose task failures. This comment is also used by build.py to determine the metadata | ||
166 | # location of shell functions. | ||
167 | o.write("# line: {0}, file: {1}\n".format( | ||
168 | d.getVarFlag(var, "lineno", False), | ||
169 | d.getVarFlag(var, "filename", False))) | ||
164 | # NOTE: should probably check for unbalanced {} within the var | 170 | # NOTE: should probably check for unbalanced {} within the var |
165 | val = val.rstrip('\n') | 171 | val = val.rstrip('\n') |
166 | o.write("%s() {\n%s\n}\n" % (varExpanded, val)) | 172 | o.write("%s() {\n%s\n}\n" % (varExpanded, val)) |