summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2011-02-25 15:36:15 -0700
committerChris Larson <chris_larson@mentor.com>2011-02-25 15:36:45 -0700
commita600b79ecefc95eeb266c3f362c7160fa8c948c1 (patch)
tree97b51cfcd548ae48329dc118e8b1d76bf8870887
parent057c3cddeb72584c6c3908bd702288cece9b66ea (diff)
downloadbitbake-a600b79ecefc95eeb266c3f362c7160fa8c948c1.tar.gz
build: switch to old cwd handling
We want this to ensure the user can run the run. script from anywhere. Signed-off-by: Chris Larson <chris_larson@mentor.com>
-rw-r--r--lib/bb/build.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/bb/build.py b/lib/bb/build.py
index 4d8a2688c..aae77e140 100644
--- a/lib/bb/build.py
+++ b/lib/bb/build.py
@@ -216,6 +216,8 @@ def exec_func_shell(function, d, runfile, cwd=None, fakeroot=False):
data.emit_func(function, script, d)
script.write("set -x\n")
+ if cwd:
+ script.write("cd %s" % cwd)
script.write("%s\n" % function)
os.fchmod(script.fileno(), 0775)
@@ -230,7 +232,7 @@ def exec_func_shell(function, d, runfile, cwd=None, fakeroot=False):
logfile = sys.stdout
try:
- bb.process.run(cmd, cwd=cwd, shell=False, stdin=NULL, log=logfile)
+ bb.process.run(cmd, shell=False, stdin=NULL, log=logfile)
except bb.process.CmdError:
logfn = d.getVar('BB_LOGFILE', True)
raise FuncFailed(function, logfn)