diff options
-rw-r--r-- | pym/portage/package/ebuild/_config/special_env_vars.py | 6 | ||||
-rw-r--r-- | pym/portage/package/ebuild/config.py | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/pym/portage/package/ebuild/_config/special_env_vars.py b/pym/portage/package/ebuild/_config/special_env_vars.py index 0214c8675..3da724d13 100644 --- a/pym/portage/package/ebuild/_config/special_env_vars.py +++ b/pym/portage/package/ebuild/_config/special_env_vars.py @@ -165,6 +165,12 @@ environ_filter += [ environ_filter = frozenset(environ_filter) +# Variables that are not allowed to have per-repo or per-package +# settings. +global_only_vars = frozenset([ + "CONFIG_PROTECT", +]) + default_globals = { 'ACCEPT_LICENSE': '* -@EULA', 'ACCEPT_PROPERTIES': '*', diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py index c8ea1c86e..c467efe81 100644 --- a/pym/portage/package/ebuild/config.py +++ b/pym/portage/package/ebuild/config.py @@ -130,6 +130,7 @@ class config(object): _environ_filter = special_env_vars.environ_filter _environ_whitelist = special_env_vars.environ_whitelist _environ_whitelist_re = special_env_vars.environ_whitelist_re + _global_only_vars = special_env_vars.global_only_vars def __init__(self, clone=None, mycpv=None, config_profile_path=None, config_incrementals=None, config_root=None, target_root=None, @@ -1142,6 +1143,8 @@ class config(object): # make a copy, since we might modify it with # package.use settings d = d.copy() + for k in self._global_only_vars: + d.pop(k, None) repo_env.append(d) cpdict = self._use_manager._repo_puse_dict.get(repo, {}).get(cp) if cpdict: @@ -1206,6 +1209,7 @@ class config(object): protected_pkg_keys = set(pkg_configdict) protected_pkg_keys.discard('USE') + protected_pkg_keys.update(self._global_only_vars) # If there are _any_ package.env settings for this package # then it automatically triggers config.reset(), in order |