summaryrefslogtreecommitdiff
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-02-12 09:09:06 +0000
committerZac Medico <zmedico@gentoo.org>2010-02-12 09:09:06 +0000
commitbfe6473628a3cca0dfc401f94997baba0267ca15 (patch)
tree7cbe7b5d6d1ee2669c32aea1e683ef6ecf14b9ca /pym
parentUse os.environ instead of the config.environ(). This solves binpkg extraction (diff)
downloadportage-idfetch-bfe6473628a3cca0dfc401f94997baba0267ca15.tar.gz
portage-idfetch-bfe6473628a3cca0dfc401f94997baba0267ca15.tar.bz2
portage-idfetch-bfe6473628a3cca0dfc401f94997baba0267ca15.zip
When creating a config instance for ROOT=/ with a clean env, copy PATH and
TERM variables, since they may be useful. svn path=/main/trunk/; revision=15345
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/__init__.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 0879b9b9..381701b6 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -9198,8 +9198,13 @@ def create_trees(config_root=None, target_root=None, trees=None):
# When ROOT != "/" we only want overrides from the calling
# environment to apply to the config that's associated
- # with ROOT != "/", so pass an empty dict for the env parameter.
- settings = config(config_root=None, target_root="/", env={})
+ # with ROOT != "/", so pass a nearly empty dict for the env parameter.
+ clean_env = {}
+ for k in ('PATH', 'TERM'):
+ v = settings.get(k)
+ if v is not None:
+ clean_env[k] = v
+ settings = config(config_root=None, target_root="/", env=clean_env)
settings.lock()
myroots.append((settings["ROOT"], settings))