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-31 10:10:22 +0000
commitbecb32bb30a9fc8ffe3bf59bbe346297a5a8899a (patch)
treea5fa3644f71f46b4aa2e387852e5ebec2d18bab8 /bitbake
parentfa34c42d192927345f8c6010bb8feb5ef12c73c5 (diff)
downloadpoky-becb32bb30a9fc8ffe3bf59bbe346297a5a8899a.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: 4d4baf20487271aa83bd9f1a778e4ea9af6f6681) 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))