From: Richard Tollerton Date: Thu, 18 Dec 2014 01:11:18 +0000 (-0600) Subject: data: escape '$' in shell variable assignment X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=18cd0ce6a55c9065c3f1bf223b47d817b5efcd8f;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git data: escape '$' in shell variable assignment Running bitbake inside make results in the exported environment variable MAKEOVERRIDES="${-*-command-variables-*-}", which the shell chokes on when trying to expand it. But of course, it probably shouldn't have been trying to expand it in the first place -- so just escape the dollar sign. Signed-off-by: Richard Tollerton Signed-off-by: Richard Purdie --- diff --git a/lib/bb/data.py b/lib/bb/data.py index eb628c7df35..82eefef1a60 100644 --- a/lib/bb/data.py +++ b/lib/bb/data.py @@ -238,6 +238,7 @@ def emit_var(var, o=sys.__stdout__, d = init(), all=False): # to a shell, we need to escape the quotes in the var alter = re.sub('"', '\\"', val) alter = re.sub('\n', ' \\\n', alter) + alter = re.sub('\\$', '\\\\$', alter) o.write('%s="%s"\n' % (varExpanded, alter)) return 0