Skip to contentSkip to conversation

data.py: fixes bad substitution when running devshell

PATCH In review Alejandro Hernandez 2 participants 3 messages Apr 9, 2015 – Apr 17, 2015

lore
Share & tools
lore
#0 lore raw

cover data.py: fixes bad substitution when running devshell

The following patch comes from: 0a791e91e55d30b328ddbd90fdb0d5911c388b96

Fixes variables passed incorrectly to shell, affecting tasks such as devshell, menuconfig, etc.

[YOCTO #7389] affects both daisy and dizzy branches, including this patch fixes the issue.

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/lib/bb/data.py | 1 +
 1 file changed, 1 insertion(+)
#1 lore raw

PATCH 1/1 data.py: fixes bad substitution when running devshell

From: Richard Tollerton <[email protected]>

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/lib/bb/data.py | 1 +
 1 file changed, 1 insertion(+)
bitbake/lib/bb/data.py +1 -0
index eb628c7..82eefef 100644
@@ -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
 
Signature · 1 line
1.9.1
#2 lore raw
Quoted 9 lines · Alejandro Hernandez

From: Richard Tollerton <[email protected]>

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)

This was already cherry-picked to 1.24 where it IIRC breaks powertop build with current oe-core/dizzy.

Please backport:

commit a3e9b391e1024d6d2e256b75c214d34e6693e332

Author: Martin Jansa <[email protected]>
Date:   Thu Dec 18 15:54:14 2014 +0100

powertop: Fix build for !uclibc

* EXTRA_LDFLAGS isn't defined for !uclibc and configure fails when it reads it unexpanded, see config.log snippet:

to unblock Dizzy builds and backport the same to Dylan before merging this to 2.22.

Quoted 29 lines
---
 bitbake/lib/bb/data.py | 1 +
 1 file changed, 1 insertion(+)
bitbake/lib/bb/data.py +1 -0
index eb628c7..82eefef 100644
@@ -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
 
Signature · 7 lines
1.9.1

-- 
_______________________________________________
bitbake-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/bitbake-devel
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]