bitbake: data.py: fixes bad substitution when running devshell
authorRichard Tollerton <rich.tollerton@ni.com>
Thu, 9 Apr 2015 20:21:49 +0000 (15:21 -0500)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Sun, 26 Jul 2015 13:13:56 +0000 (10:13 -0300)
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.

(Bitbake rev: 18cd0ce6a55c9065c3f1bf223b47d817b5efcd8f)

(Bitbake rev: 34226a9e02f319a7547967bbdaca3ca918927dd1)

Signed-off-by: Richard Tollerton <rich.tollerton@ni.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
bitbake/lib/bb/data.py

index eb628c7..82eefef 100644 (file)
@@ -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