config: blacklist vars loaded from profile.env
authorZac Medico <zmedico@gentoo.org>
Sat, 13 Aug 2011 12:54:21 +0000 (05:54 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 13 Aug 2011 12:54:21 +0000 (05:54 -0700)
pym/portage/package/ebuild/config.py

index a591c9ad74ff8defe6eee1b4a96975eb77fdb2d7..8cca0ef25db0f8c22c5ce9689991229c5525fd66 100644 (file)
@@ -208,6 +208,7 @@ class config(object):
                        self.repositories = clone.repositories
                        self._iuse_implicit_match = clone._iuse_implicit_match
                        self._non_user_variables = clone._non_user_variables
+                       self._env_d_blacklist = clone._env_d_blacklist
                        self._repo_make_defaults = clone._repo_make_defaults
                        self.usemask = clone.usemask
                        self.useforce = clone.useforce
@@ -439,6 +440,14 @@ class config(object):
                        non_user_variables = frozenset(non_user_variables)
                        self._non_user_variables = non_user_variables
 
+                       self._env_d_blacklist = frozenset(chain(
+                               profile_only_variables,
+                               self._env_blacklist,
+                       ))
+                       env_d = self.configdict["env.d"]
+                       for k in self._env_d_blacklist:
+                               env_d.pop(k, None)
+
                        for k in profile_only_variables:
                                self.mygcfg.pop(k, None)
 
@@ -1702,6 +1711,8 @@ class config(object):
                env_d = getconfig(env_d_filename, expand=False)
                if env_d:
                        # env_d will be None if profile.env doesn't exist.
+                       for k in self._env_d_blacklist:
+                               env_d.pop(k, None)
                        self.configdict["env.d"].update(env_d)
 
        def regenerate(self, useonly=0, use_cache=None):