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>
Wed, 24 Nov 2010 01:37:24 +0000 (17:37 -0800)
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 d302b52427f58060887bb7445fdde4438c7a880e..33ac561d379ba19ddf079440863e20d3834d26e1 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 d14d06b7a30c3cdce2f6be4b5e92be9112ada43d..89fdca09277667acd495c8cdd719d426dbb5e3d3 100644 (file)
@@ -3828,6 +3828,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)