1 |
commit: 9b8263d38ffe6213056332d38162048a0cd28857 |
2 |
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org> |
3 |
AuthorDate: Wed Sep 26 21:44:59 2018 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Oct 8 21:56:26 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=9b8263d3 |
7 |
|
8 |
portage.repository.config: Sort some tuples and put each element on separate line. |
9 |
|
10 |
It will make future changes easier and more readable. |
11 |
|
12 |
Reviewed-by: Brian Dolbec <dolsen <AT> gentoo.org> |
13 |
Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org> |
14 |
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org> |
15 |
|
16 |
lib/portage/repository/config.py | 122 +++++++++++++++++++++++++++++---------- |
17 |
1 file changed, 92 insertions(+), 30 deletions(-) |
18 |
|
19 |
diff --git a/lib/portage/repository/config.py b/lib/portage/repository/config.py |
20 |
index 8cdc2a696..482711c4b 100644 |
21 |
--- a/lib/portage/repository/config.py |
22 |
+++ b/lib/portage/repository/config.py |
23 |
@@ -74,29 +74,61 @@ def _find_invalid_path_char(path, pos=0, endpos=None): |
24 |
class RepoConfig(object): |
25 |
"""Stores config of one repository""" |
26 |
|
27 |
- __slots__ = ('aliases', 'allow_missing_manifest', 'allow_provide_virtual', |
28 |
- 'auto_sync', 'cache_formats', 'clone_depth', |
29 |
- 'create_manifest', 'disable_manifest', |
30 |
- 'eapi', 'eclass_db', 'eclass_locations', 'eclass_overrides', |
31 |
- 'find_invalid_path_char', 'force', 'format', 'local_config', 'location', |
32 |
- 'main_repo', 'manifest_hashes', 'masters', 'missing_repo_name', |
33 |
- 'name', 'portage1_profiles', 'portage1_profiles_compat', 'priority', |
34 |
- 'profile_formats', 'sign_commit', 'sign_manifest', 'strict_misc_digests', |
35 |
- 'sync_depth', 'sync_hooks_only_on_change', |
36 |
- 'sync_type', 'sync_umask', 'sync_uri', 'sync_user', 'thin_manifest', |
37 |
- 'update_changelog', 'user_location', '_eapis_banned', '_eapis_deprecated', |
38 |
- '_masters_orig', 'module_specific_options', 'manifest_required_hashes', |
39 |
+ __slots__ = ( |
40 |
+ 'aliases', |
41 |
+ 'allow_missing_manifest', |
42 |
+ 'allow_provide_virtual', |
43 |
+ 'auto_sync', |
44 |
+ 'cache_formats', |
45 |
+ 'clone_depth', |
46 |
+ 'create_manifest', |
47 |
+ 'disable_manifest', |
48 |
+ 'eapi', |
49 |
+ 'eclass_db', |
50 |
+ 'eclass_locations', |
51 |
+ 'eclass_overrides', |
52 |
+ 'find_invalid_path_char', |
53 |
+ 'force', |
54 |
+ 'format', |
55 |
+ 'local_config', |
56 |
+ 'location', |
57 |
+ 'main_repo', |
58 |
+ 'manifest_hashes', |
59 |
+ 'manifest_required_hashes', |
60 |
+ 'masters', |
61 |
+ 'missing_repo_name', |
62 |
+ 'module_specific_options', |
63 |
+ 'name', |
64 |
+ 'portage1_profiles', |
65 |
+ 'portage1_profiles_compat', |
66 |
+ 'priority', |
67 |
+ 'profile_formats', |
68 |
+ 'sign_commit', |
69 |
+ 'sign_manifest', |
70 |
+ 'strict_misc_digests', |
71 |
'sync_allow_hardlinks', |
72 |
+ 'sync_depth', |
73 |
+ 'sync_hooks_only_on_change', |
74 |
'sync_openpgp_key_path', |
75 |
'sync_openpgp_key_refresh_retry_count', |
76 |
- 'sync_openpgp_key_refresh_retry_delay_max', |
77 |
'sync_openpgp_key_refresh_retry_delay_exp_base', |
78 |
+ 'sync_openpgp_key_refresh_retry_delay_max', |
79 |
'sync_openpgp_key_refresh_retry_delay_mult', |
80 |
'sync_openpgp_key_refresh_retry_overall_timeout', |
81 |
'sync_rcu', |
82 |
- 'sync_rcu_store_dir', |
83 |
'sync_rcu_spare_snapshots', |
84 |
+ 'sync_rcu_store_dir', |
85 |
'sync_rcu_ttl_days', |
86 |
+ 'sync_type', |
87 |
+ 'sync_umask', |
88 |
+ 'sync_uri', |
89 |
+ 'sync_user', |
90 |
+ 'thin_manifest', |
91 |
+ 'update_changelog', |
92 |
+ 'user_location', |
93 |
+ '_eapis_banned', |
94 |
+ '_eapis_deprecated', |
95 |
+ '_masters_orig', |
96 |
) |
97 |
|
98 |
def __init__(self, name, repo_opts, local_config=True): |
99 |
@@ -196,8 +228,8 @@ class RepoConfig(object): |
100 |
'sync-openpgp-key-path', None) |
101 |
|
102 |
for k in ('sync_openpgp_key_refresh_retry_count', |
103 |
- 'sync_openpgp_key_refresh_retry_delay_max', |
104 |
'sync_openpgp_key_refresh_retry_delay_exp_base', |
105 |
+ 'sync_openpgp_key_refresh_retry_delay_max', |
106 |
'sync_openpgp_key_refresh_retry_delay_mult', |
107 |
'sync_openpgp_key_refresh_retry_overall_timeout'): |
108 |
setattr(self, k, repo_opts.get(k.replace('_', '-'), None)) |
109 |
@@ -556,23 +588,34 @@ class RepoConfigLoader(object): |
110 |
if repos_conf_opts is not None: |
111 |
# Selectively copy only the attributes which |
112 |
# repos.conf is allowed to override. |
113 |
- for k in ('aliases', 'auto_sync', |
114 |
- 'clone_depth', 'eclass_overrides', |
115 |
- 'force', 'masters', 'priority', 'strict_misc_digests', |
116 |
- 'sync_depth', 'sync_hooks_only_on_change', |
117 |
+ for k in ( |
118 |
+ 'aliases', |
119 |
+ 'auto_sync', |
120 |
+ 'clone_depth', |
121 |
+ 'eclass_overrides', |
122 |
+ 'force', |
123 |
+ 'masters', |
124 |
+ 'module_specific_options', |
125 |
+ 'priority', |
126 |
+ 'strict_misc_digests', |
127 |
'sync_allow_hardlinks', |
128 |
+ 'sync_depth', |
129 |
+ 'sync_hooks_only_on_change', |
130 |
'sync_openpgp_key_path', |
131 |
'sync_openpgp_key_refresh_retry_count', |
132 |
- 'sync_openpgp_key_refresh_retry_delay_max', |
133 |
'sync_openpgp_key_refresh_retry_delay_exp_base', |
134 |
+ 'sync_openpgp_key_refresh_retry_delay_max', |
135 |
'sync_openpgp_key_refresh_retry_delay_mult', |
136 |
'sync_openpgp_key_refresh_retry_overall_timeout', |
137 |
'sync_rcu', |
138 |
- 'sync_rcu_store_dir', |
139 |
'sync_rcu_spare_snapshots', |
140 |
+ 'sync_rcu_store_dir', |
141 |
'sync_rcu_ttl_days', |
142 |
- 'sync_type', 'sync_umask', 'sync_uri', 'sync_user', |
143 |
- 'module_specific_options'): |
144 |
+ 'sync_type', |
145 |
+ 'sync_umask', |
146 |
+ 'sync_uri', |
147 |
+ 'sync_user', |
148 |
+ ): |
149 |
v = getattr(repos_conf_opts, k, None) |
150 |
if v is not None: |
151 |
setattr(repo, k, v) |
152 |
@@ -991,19 +1034,38 @@ class RepoConfigLoader(object): |
153 |
return repo_name in self.prepos |
154 |
|
155 |
def config_string(self): |
156 |
- bool_keys = ("strict_misc_digests", "sync_allow_hardlinks", "sync_rcu") |
157 |
- str_or_int_keys = ("auto_sync", "clone_depth", "format", "location", |
158 |
- "main_repo", "priority", "sync_depth", "sync_openpgp_key_path", |
159 |
+ bool_keys = ( |
160 |
+ "strict_misc_digests", |
161 |
+ "sync_allow_hardlinks", |
162 |
+ "sync_rcu", |
163 |
+ ) |
164 |
+ str_or_int_keys = ( |
165 |
+ "auto_sync", |
166 |
+ "clone_depth", |
167 |
+ "format", |
168 |
+ "location", |
169 |
+ "main_repo", |
170 |
+ "priority", |
171 |
+ "sync_depth", |
172 |
+ "sync_openpgp_key_path", |
173 |
"sync_openpgp_key_refresh_retry_count", |
174 |
- "sync_openpgp_key_refresh_retry_delay_max", |
175 |
"sync_openpgp_key_refresh_retry_delay_exp_base", |
176 |
+ "sync_openpgp_key_refresh_retry_delay_max", |
177 |
"sync_openpgp_key_refresh_retry_delay_mult", |
178 |
"sync_openpgp_key_refresh_retry_overall_timeout", |
179 |
- "sync_rcu_store_dir", |
180 |
"sync_rcu_spare_snapshots", |
181 |
+ "sync_rcu_store_dir", |
182 |
"sync_rcu_ttl_days", |
183 |
- "sync_type", "sync_umask", "sync_uri", 'sync_user') |
184 |
- str_tuple_keys = ("aliases", "eclass_overrides", "force") |
185 |
+ "sync_type", |
186 |
+ "sync_umask", |
187 |
+ "sync_uri", |
188 |
+ "sync_user", |
189 |
+ ) |
190 |
+ str_tuple_keys = ( |
191 |
+ "aliases", |
192 |
+ "eclass_overrides", |
193 |
+ "force", |
194 |
+ ) |
195 |
repo_config_tuple_keys = ("masters",) |
196 |
keys = bool_keys + str_or_int_keys + str_tuple_keys + repo_config_tuple_keys |
197 |
config_string = "" |