[bitbake-devel,4/5,dora] bitbake: build.py: add single-quotes around already-expanded directory name

Submitted by Robert Yang on Dec. 10, 2013, 3:09 p.m. | Patch ID: 63147


Message ID 938f6010fa84c1a18d2fed6ec29cc0bfdf551fe8.1386680149.git.liezhi.yang@windriver.com
State New
Headers show

Commit Message

Robert Yang Dec. 10, 2013, 3:09 p.m.
From: Peter Seebach <peter.seebach@windriver.com>

If the computed name of a directory contains an undefined variable
reference, bitbake dutifully creates a directory with a name that has
${...} in it. However, the actual task script created then tries to cd
to that directory, and the cd command fails, because no such directory
exists -- because the shell has helpfully removed the ${...} which did
not match any actual variables.

Since we want the name to be used exactly-as-is, add single quotes around
the name so this doesn't cause strange failures running tasks, which
allows us to progress past such failures and get to a point where they
can be diagnosed.

(Bitbake master rev: 2809c2e6f2f35f9b08058950be896947ab5a0284)

Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
 bitbake/lib/bb/build.py |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
index 2e49a09..edab556 100644
--- a/bitbake/lib/bb/build.py
+++ b/bitbake/lib/bb/build.py
@@ -285,7 +285,7 @@  set -e
         if bb.msg.loggerVerboseLogs:
             script.write("set -x\n")
         if cwd:
-            script.write("cd %s\n" % cwd)
+            script.write("cd '%s'\n" % cwd)
         script.write("%s\n" % func)
 # cleanup