bitbake: save the initial PATH for use when starting a subprocess

It was possible for bitbake-runtime to be run against a semi-installed
python-native resulting in tracebacks with ImportError's.

To prevent this we stash the initial PATH in the BBConfiguration when bitbake
is started and then set this in the env when launching bitbake-runtask through
subprocesses Popen() call.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
This commit is contained in:
Joshua Lock 2010-09-08 18:38:43 +01:00 committed by Richard Purdie
parent 8be5593777
commit 3e7db72216
2 changed files with 2 additions and 0 deletions

View File

@ -157,6 +157,7 @@ Default BBFILES are the .bb files in the current directory.""")
configuration = BBConfiguration(options)
configuration.pkgs_to_build.extend(args[1:])
configuration.initial_path = os.environ['PATH']
#server = bb.server.xmlrpc
server = bb.server.none

View File

@ -1042,6 +1042,7 @@ class RunQueueExecute:
env[comps[0]] = comps[1]
env['BB_TASKHASH'] = self.rqdata.runq_hash[task]
env['PATH'] = self.cooker.configuration.initial_path
sys.stdout.flush()
sys.stderr.flush()