1 |
commit: 84f53ead91047d1389c80edeb7d9d1720e07e2a4 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Jun 27 00:34:13 2011 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jun 27 00:34:13 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=84f53ead |
7 |
|
8 |
config: disallow per-package/repo CONFIG_PROTECT |
9 |
|
10 |
In order for reliable etc-update behavior, CONFIG_PROTECT needs to be |
11 |
a global constant (see bug 370693, comment #8). |
12 |
|
13 |
--- |
14 |
.../package/ebuild/_config/special_env_vars.py | 6 ++++++ |
15 |
pym/portage/package/ebuild/config.py | 4 ++++ |
16 |
2 files changed, 10 insertions(+), 0 deletions(-) |
17 |
|
18 |
diff --git a/pym/portage/package/ebuild/_config/special_env_vars.py b/pym/portage/package/ebuild/_config/special_env_vars.py |
19 |
index 0214c86..3da724d 100644 |
20 |
--- a/pym/portage/package/ebuild/_config/special_env_vars.py |
21 |
+++ b/pym/portage/package/ebuild/_config/special_env_vars.py |
22 |
@@ -165,6 +165,12 @@ environ_filter += [ |
23 |
|
24 |
environ_filter = frozenset(environ_filter) |
25 |
|
26 |
+# Variables that are not allowed to have per-repo or per-package |
27 |
+# settings. |
28 |
+global_only_vars = frozenset([ |
29 |
+ "CONFIG_PROTECT", |
30 |
+]) |
31 |
+ |
32 |
default_globals = { |
33 |
'ACCEPT_LICENSE': '* -@EULA', |
34 |
'ACCEPT_PROPERTIES': '*', |
35 |
|
36 |
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py |
37 |
index c8ea1c8..c467efe 100644 |
38 |
--- a/pym/portage/package/ebuild/config.py |
39 |
+++ b/pym/portage/package/ebuild/config.py |
40 |
@@ -130,6 +130,7 @@ class config(object): |
41 |
_environ_filter = special_env_vars.environ_filter |
42 |
_environ_whitelist = special_env_vars.environ_whitelist |
43 |
_environ_whitelist_re = special_env_vars.environ_whitelist_re |
44 |
+ _global_only_vars = special_env_vars.global_only_vars |
45 |
|
46 |
def __init__(self, clone=None, mycpv=None, config_profile_path=None, |
47 |
config_incrementals=None, config_root=None, target_root=None, |
48 |
@@ -1142,6 +1143,8 @@ class config(object): |
49 |
# make a copy, since we might modify it with |
50 |
# package.use settings |
51 |
d = d.copy() |
52 |
+ for k in self._global_only_vars: |
53 |
+ d.pop(k, None) |
54 |
repo_env.append(d) |
55 |
cpdict = self._use_manager._repo_puse_dict.get(repo, {}).get(cp) |
56 |
if cpdict: |
57 |
@@ -1206,6 +1209,7 @@ class config(object): |
58 |
|
59 |
protected_pkg_keys = set(pkg_configdict) |
60 |
protected_pkg_keys.discard('USE') |
61 |
+ protected_pkg_keys.update(self._global_only_vars) |
62 |
|
63 |
# If there are _any_ package.env settings for this package |
64 |
# then it automatically triggers config.reset(), in order |