Merged from trunk 8815:8818
authorFabian Groffen <grobian@gentoo.org>
Mon, 3 Dec 2007 17:52:42 +0000 (17:52 -0000)
committerFabian Groffen <grobian@gentoo.org>
Mon, 3 Dec 2007 17:52:42 +0000 (17:52 -0000)
   | 8816    | For compatibility with cvs.eclass, do not unset CVS_RSH in   |
   | zmedico | save_ebuild_env() since that variable may be initialized in  |
   |         | global scope.                                                |

   | 8818    | * whitelist CCACHE_* and DISTCC_* variables in               |
   | zmedico | config.environ() * unset CCACHE_* and DISTCC_* variables in  |
   |         | save_ebuild_env()                                            |

svn path=/main/branches/prefix/; revision=8820

bin/isolated-functions.sh
pym/portage/__init__.py

index 2d228051682e4b5517f88685a821ec020ae3c190..4c94bbb8069522af52a3f8aa0d8024bb01e922ad 100755 (executable)
@@ -408,9 +408,12 @@ save_ebuild_env() {
                        TERM TERMCAP USER
 
                # other variables inherited from the calling environment
-               unset CVS_RSH ECHANGELOG_USER GPG_AGENT_INFO \
+               unset ECHANGELOG_USER GPG_AGENT_INFO \
                SSH_AGENT_PID SSH_AUTH_SOCK STY WINDOW XAUTHORITY
 
+               # CCACHE and DISTCC config
+               unset ${!CCACHE_*} ${!DISTCC_*}
+
                # There's no need to bloat environment.bz2 with internally defined
                # functions and variables, so filter them out if possible.
 
index 93bf7a3281bc6def9da742ac6cf6a45747ed36e2..7b68e085d88e0ad491ef5770d56b7ccf6ded75be 100644 (file)
@@ -895,6 +895,8 @@ class config(object):
 
        _environ_whitelist = frozenset(_environ_whitelist)
 
+       _environ_whitelist_re = re.compile(r'^(CCACHE_|DISTCC_).*')
+
        # Filter selected variables in the config.environ() method so that
        # they don't needlessly propagate down into the ebuild environment.
        _environ_filter = []
@@ -2587,7 +2589,8 @@ class config(object):
                                        (x, myvalue), noiselevel=-1)
                                continue
                        if filter_calling_env and \
-                               x not in environ_whitelist:
+                               x not in environ_whitelist and \
+                               not self._environ_whitelist_re.match(x):
                                if myvalue == env_d.get(x) or \
                                        myvalue == os.environ.get(x):
                                        continue