summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2014-12-08 16:37:26 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-12-09 22:15:49 +0000
commiteb2ea6fd2d2dc626ead13de1ec334d4220651612 (patch)
tree8322bbcc09ae909f8ffa21b3a65bf8bd0f3ba3aa /bitbake
parent9c02ad9fc90409edea6186dbe7024f03b8e3f010 (diff)
downloadpoky-eb2ea6fd2d2dc626ead13de1ec334d4220651612.tar.gz
bitbake: data: Handle BASH_FUNC shellshock implication
The shellshock patches changed the way bash functions are exported. Unfortunately different distros used slightly different formats, Fedora went with BASH_FUNC_XXX()=() { echo foo; } and Ubuntu went with BASH_FUNC_foo%%=() { echo foo; }. The former causes errors in dealing with out output from emit_env, the functions are not exported in either case any more. This patch handles things so the functions work as expected in either case. [YOCTO #6880] (Bitbake rev: f28f37220e7787721a31b659521a1c44ebea92bf) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/data.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py
index 91b1eb1298..eb628c7df3 100644
--- a/bitbake/lib/bb/data.py
+++ b/bitbake/lib/bb/data.py
@@ -219,6 +219,13 @@ def emit_var(var, o=sys.__stdout__, d = init(), all=False):
219 219
220 val = str(val) 220 val = str(val)
221 221
222 if varExpanded.startswith("BASH_FUNC_"):
223 varExpanded = varExpanded[10:-2]
224 val = val[3:] # Strip off "() "
225 o.write("%s() %s\n" % (varExpanded, val))
226 o.write("export -f %s\n" % (varExpanded))
227 return 1
228
222 if func: 229 if func:
223 # NOTE: should probably check for unbalanced {} within the var 230 # NOTE: should probably check for unbalanced {} within the var
224 o.write("%s() {\n%s\n}\n" % (varExpanded, val)) 231 o.write("%s() {\n%s\n}\n" % (varExpanded, val))