From: Chris Larson Date: Fri, 25 Feb 2011 22:36:15 +0000 (-0700) Subject: build: switch to old cwd handling X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a600b79ecefc95eeb266c3f362c7160fa8c948c1;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git 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 --- diff --git a/lib/bb/build.py b/lib/bb/build.py index 4d8a2688cdb..aae77e14035 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)