diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-11-22 16:17:39 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-01-02 13:08:47 +0000 |
commit | 54534a61003fee8075458c3a7f117fc7c7c4f34f (patch) | |
tree | 12196c35a4f05ee0ddb1c869e1b3b1dea0c13a2d /bitbake/lib | |
parent | faef2d9588821077b289e06021da76fa6da53d9a (diff) | |
download | poky-54534a61003fee8075458c3a7f117fc7c7c4f34f.tar.gz |
bitbake: data: Fix output inconsistencies for emit_var
VAL = "" (not shown)
VAL = " " (shown as "")
VAL = " x" (shown as "x")
would all show up rather differently to what would be expected in the
bitbake -e output. This fixes things so they appear consistently.
The output for running some shell functions may also change slightly
but shouldn't change in a way that is likely to cause problems.
[YOCTO #5507]
(Bitbake rev: 9f37afff200d748beddc2a70f55a72c2714e3120)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-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 349fcfe878..bdd1e79e24 100644 --- a/bitbake/lib/bb/data.py +++ b/bitbake/lib/bb/data.py | |||
@@ -214,7 +214,7 @@ def emit_var(var, o=sys.__stdout__, d = init(), all=False): | |||
214 | o.write('unset %s\n' % varExpanded) | 214 | o.write('unset %s\n' % varExpanded) |
215 | return 0 | 215 | return 0 |
216 | 216 | ||
217 | if not val: | 217 | if val is None: |
218 | return 0 | 218 | return 0 |
219 | 219 | ||
220 | val = str(val) | 220 | val = str(val) |
@@ -229,7 +229,7 @@ def emit_var(var, o=sys.__stdout__, d = init(), all=False): | |||
229 | 229 | ||
230 | # if we're going to output this within doublequotes, | 230 | # if we're going to output this within doublequotes, |
231 | # to a shell, we need to escape the quotes in the var | 231 | # to a shell, we need to escape the quotes in the var |
232 | alter = re.sub('"', '\\"', val.strip()) | 232 | alter = re.sub('"', '\\"', val) |
233 | alter = re.sub('\n', ' \\\n', alter) | 233 | alter = re.sub('\n', ' \\\n', alter) |
234 | o.write('%s="%s"\n' % (varExpanded, alter)) | 234 | o.write('%s="%s"\n' % (varExpanded, alter)) |
235 | return 0 | 235 | return 0 |