* whitelist CCACHE_* and DISTCC_* variables in config.environ()
authorZac Medico <zmedico@gentoo.org>
Mon, 3 Dec 2007 06:23:45 +0000 (06:23 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 3 Dec 2007 06:23:45 +0000 (06:23 -0000)
* unset CCACHE_* and DISTCC_* variables in save_ebuild_env()
(trunk r8818)

svn path=/main/branches/2.1.2/; revision=8819

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

index f6ca22654947b0542053c207b7a05704b27c5046..dfe4cfba759dc8ce6fa3de8330058152746b2228 100644 (file)
@@ -409,6 +409,9 @@ save_ebuild_env() {
                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 7bb53cc5619fac592171258885be162f4d15e7c9..015dad08f0aef62586b1d0648d7ac8cd92dfd74e 100644 (file)
@@ -1025,6 +1025,8 @@ class config:
 
        _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 = []
@@ -2551,7 +2553,8 @@ class config:
                                        (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