]> code.ossystems Code Review - openembedded-core.git/commitdiff
bitbake: save the initial PATH for use when starting a subprocess
authorJoshua Lock <josh@linux.intel.com>
Wed, 8 Sep 2010 17:38:43 +0000 (18:38 +0100)
committerRichard Purdie <rpurdie@linux.intel.com>
Wed, 8 Sep 2010 18:22:37 +0000 (19:22 +0100)
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>
bitbake/bin/bitbake
bitbake/lib/bb/runqueue.py

index 4e6815e46e33627ea12c7a7a19968f8c504ab728..b046156b49be3bc1dde035d804d241a327a83817 100755 (executable)
@@ -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
index 3d84bb17ee734af0ab0050ba111bfb9b58a79cba..4d1dc49d789ebf4958e470bc3d2ba51bd0902939 100644 (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()