summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/data.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/data.py')
-rw-r--r--bitbake/lib/bb/data.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py
index 6ec522aa48..53ce7d62d3 100644
--- a/bitbake/lib/bb/data.py
+++ b/bitbake/lib/bb/data.py
@@ -192,7 +192,8 @@ def emit_var(var, o=sys.__stdout__, d = init(), all=False):
192 return 0 192 return 0
193 193
194 if all: 194 if all:
195 o.write('# %s=%s\n' % (var, oval)) 195 commentVal = re.sub('\n', '\n#', str(oval))
196 o.write('# %s=%s\n' % (var, commentVal))
196 197
197 if (var.find("-") != -1 or var.find(".") != -1 or var.find('{') != -1 or var.find('}') != -1 or var.find('+') != -1) and not all: 198 if (var.find("-") != -1 or var.find(".") != -1 or var.find('{') != -1 or var.find('}') != -1 or var.find('+') != -1) and not all:
198 return 0 199 return 0
@@ -219,6 +220,7 @@ def emit_var(var, o=sys.__stdout__, d = init(), all=False):
219 # if we're going to output this within doublequotes, 220 # if we're going to output this within doublequotes,
220 # to a shell, we need to escape the quotes in the var 221 # to a shell, we need to escape the quotes in the var
221 alter = re.sub('"', '\\"', val.strip()) 222 alter = re.sub('"', '\\"', val.strip())
223 alter = re.sub('\n', ' \\\n', alter)
222 o.write('%s="%s"\n' % (varExpanded, alter)) 224 o.write('%s="%s"\n' % (varExpanded, alter))
223 return 0 225 return 0
224 226