lock-helper.py: use PORTAGE_PYM_PATH for safety
authorZac Medico <zmedico@gentoo.org>
Fri, 22 Oct 2010 01:32:08 +0000 (18:32 -0700)
committerZac Medico <zmedico@gentoo.org>
Fri, 22 Oct 2010 01:32:08 +0000 (18:32 -0700)
bin/lock-helper.py
pym/_emerge/AsynchronousLock.py
pym/portage/__init__.py
pym/portage/dbapi/vartree.py

index 5c332b2afd4d219b97644c0ba9417e0189225f7e..469d3a9da5921023f509591399af4031c36afa40 100755 (executable)
@@ -2,7 +2,9 @@
 # Copyright 2010 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+import os
 import sys
+sys.path.insert(0, os.environ['PORTAGE_PYM_PATH'])
 import portage
 
 def main(args):
index bce81ed5c674fc461f7a4508e23bb6c7b95c521a..d72add4f1a421fcef7b4889f03b9682d8b611598 100644 (file)
@@ -171,7 +171,7 @@ class _LockProcess(AbstractPollTask):
                self._proc = SpawnProcess(
                        args=[portage._python_interpreter,
                                os.path.join(portage._bin_path, 'lock-helper.py'), self.path],
-                               env=os.environ,
+                               env=dict(os.environ, PORTAGE_PYM_PATH=portage._pym_path),
                                fd_pipes={0:out_pr, 1:in_pw, 2:sys.stderr.fileno()},
                                scheduler=self.scheduler)
                self._proc.addExitListener(self._proc_exit)
index 2dedde49bb8b56939b3bef780c18c68039e40f0e..1e6f21b22657568e82c94c2535f6b1046ff07ca6 100644 (file)
@@ -328,6 +328,7 @@ except (ImportError, OSError) as e:
 
 _python_interpreter = os.path.realpath(sys.executable)
 _bin_path = PORTAGE_BIN_PATH
+_pym_path = PORTAGE_PYM_PATH
 
 def _ensure_default_encoding():
 
index 18a3c0d7ca18b8b5ec2ef6fe99a00a8e5859037f..571b344f31715eaf33cf4d3fcd2e431160164dd9 100644 (file)
@@ -3829,6 +3829,7 @@ class dblink(object):
                                shutil.copytree(var_orig, var_new, symlinks=True)
                                os.chmod(var_new, dir_perms)
                        portage._bin_path = settings['PORTAGE_BIN_PATH']
+                       portage._pym_path = settings['PORTAGE_PYM_PATH']
                        os.chmod(base_path_tmp, dir_perms)
                        # This serves so pre-load the modules.
                        _preload_elog_modules(self.settings)