build: switch to old cwd handling

We want this to ensure the user can run the run. script from anywhere.

(Bitbake rev: a600b79ecefc95eeb266c3f362c7160fa8c948c1)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Chris Larson 2011-02-25 15:36:15 -07:00 committed by Richard Purdie
parent 78c2b79d54
commit 043b70419e
1 changed files with 3 additions and 3 deletions

View File

@ -221,7 +221,8 @@ def exec_func_shell(function, d, runfile, cwd=None):
if logger.isEnabledFor(logging.DEBUG):
script.write("set -x\n")
data.emit_func(function, script, d)
if cwd:
script.write("cd %s" % cwd)
script.write("%s\n" % function)
os.fchmod(script.fileno(), 0775)
@ -238,8 +239,7 @@ def exec_func_shell(function, d, runfile, cwd=None):
logfile = sys.stdout
try:
bb.process.run(cmd, env=env, cwd=cwd, shell=False, stdin=NULL,
log=logfile)
bb.process.run(cmd, env=env, shell=False, stdin=NULL, log=logfile)
except bb.process.CmdError:
logfn = d.getVar('BB_LOGFILE', True)
raise FuncFailed(function, logfn)