summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-03-02 20:13:24 +0000
committerZac Medico <zmedico@gentoo.org>2010-03-02 20:13:24 +0000
commit91ce21d28a2a84c825bc3094f3b9179b51923631 (patch)
tree0a80bd10b20bdc8f7f7877be40ac9cd7e23744e6 /pym
parent6d073936d2dda15449c17ae11bd04d178f895026 (diff)
downloadportage-91ce21d28a2a84c825bc3094f3b9179b51923631.tar.gz
portage-91ce21d28a2a84c825bc3094f3b9179b51923631.tar.bz2
portage-91ce21d28a2a84c825bc3094f3b9179b51923631.zip
When creating a config instance for ROOT=/ with a clean env, copy PATH and
TERM variables, since they may be useful. (trunk r15345) svn path=/main/branches/2.1.7/; revision=15572
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 e7667e131..0708aead8 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -9195,8 +9195,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))