1 |
commit: a91492450d86abb34bbd05ccaf0e60d8b1c973a0 |
2 |
Author: Adam Mills <adam <AT> armills <DOT> info> |
3 |
AuthorDate: Wed May 25 16:12:56 2016 +0000 |
4 |
Commit: Alexander Berntsen <bernalex <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri May 27 08:22:48 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=a9149245 |
7 |
|
8 |
Revert "Colorize packages in user sets (bug 577720)" |
9 |
|
10 |
This reverts commit 739845a6eab95fbc44eab1b7b938c860563631d7. |
11 |
|
12 |
The feature implemented in this commit for bug 577720 was determined to |
13 |
be an overcomplicated method of colorizing user sets. Instead, this |
14 |
feature will be implemented as in bug 583164. The configuration options |
15 |
implemented in this reverted commit will be removed. Per bug 583164, |
16 |
packages that belong to a set listed in world_sets will be colorized as |
17 |
world packages. This eliminates the extra configuration and associated |
18 |
complications. |
19 |
|
20 |
See bug 583164 for more details. |
21 |
|
22 |
Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org> |
23 |
Acked-by: Zac Medico <zmedico <AT> gentoo.org |
24 |
Signed-off-by: Alexander Berntsen <bernalex <AT> gentoo.org> |
25 |
|
26 |
cnf/sets/portage.conf | 1 - |
27 |
doc/config/sets.docbook | 4 +--- |
28 |
man/color.map.5 | 11 ---------- |
29 |
man/portage.5 | 1 - |
30 |
pym/_emerge/resolver/output.py | 25 +++++++--------------- |
31 |
pym/_emerge/resolver/output_helpers.py | 17 +++------------ |
32 |
pym/portage/_sets/__init__.py | 8 ------- |
33 |
pym/portage/_sets/base.py | 1 - |
34 |
pym/portage/output.py | 39 ++++++++++++++++------------------ |
35 |
9 files changed, 30 insertions(+), 77 deletions(-) |
36 |
|
37 |
diff --git a/cnf/sets/portage.conf b/cnf/sets/portage.conf |
38 |
index e990620..ac282d9 100644 |
39 |
--- a/cnf/sets/portage.conf |
40 |
+++ b/cnf/sets/portage.conf |
41 |
@@ -49,7 +49,6 @@ class = portage.sets.files.StaticFileSet |
42 |
multiset = true |
43 |
directory = %(PORTAGE_CONFIGROOT)setc/portage/sets |
44 |
world-candidate = True |
45 |
-user-set = True |
46 |
|
47 |
# Set to rebuild all packages that need a preserved lib that only remains due |
48 |
# to FEATURES=preserve-libs |
49 |
|
50 |
diff --git a/doc/config/sets.docbook b/doc/config/sets.docbook |
51 |
index 02135d6..749b775 100644 |
52 |
--- a/doc/config/sets.docbook |
53 |
+++ b/doc/config/sets.docbook |
54 |
@@ -57,8 +57,6 @@ |
55 |
is missing)</para></listitem> |
56 |
<listitem><para><varname>world-candidate</varname>, which determines if |
57 |
given package should be added to the <varname>world</varname> set</para></listitem> |
58 |
- <listitem><para><varname>user-set</varname>, which determines if |
59 |
- given package should be colorized as a user set</para></listitem> |
60 |
</itemizedlist> |
61 |
<para> |
62 |
Some handler classes might require additional options for their configuration, |
63 |
@@ -95,7 +93,7 @@ |
64 |
but to indicate that the section should generate multiple sets it's |
65 |
also necessary to set the <varname>multiset</varname> option to |
66 |
<parameter>true</parameter>. The <varname>world-candidate</varname> |
67 |
- and <varname>user-set</varname> options are also supported like with |
68 |
+ option also supported like with |
69 |
single sets (they'll apply to all sets generated by the section). |
70 |
</para> |
71 |
<para> |
72 |
|
73 |
diff --git a/man/color.map.5 b/man/color.map.5 |
74 |
index 39f23f7..5543628 100644 |
75 |
--- a/man/color.map.5 |
76 |
+++ b/man/color.map.5 |
77 |
@@ -46,9 +46,6 @@ Defines color used for satisfied blockers. |
78 |
\fBPKG_MERGE\fR = \fI"darkgreen"\fR |
79 |
Defines color used for packages planned to be merged. |
80 |
.TP |
81 |
-\fBPKG_MERGE_USER_SET\fR = \fI"darkgreen"\fR |
82 |
-Defines color used for packages planned to be merged from a user defined set. |
83 |
-.TP |
84 |
\fBPKG_MERGE_SYSTEM\fR = \fI"darkgreen"\fR |
85 |
Defines color used for system packages planned to be merged. |
86 |
.TP |
87 |
@@ -58,10 +55,6 @@ Defines color used for world packages planned to be merged. |
88 |
\fBPKG_BINARY_MERGE\fR = \fI"purple"\fR |
89 |
Defines color used for packages planned to be merged using a binary package. |
90 |
.TP |
91 |
-\fBPKG_BINARY_MERGE_USER_SET\fR = \fI"purple"\fR |
92 |
-Defines color used for packages planned to be merged using a binary package |
93 |
-from a user defined set. |
94 |
-.TP |
95 |
\fBPKG_BINARY_MERGE_SYSTEM\fR = \fI"purple"\fR |
96 |
Defines color used for system packages planned to be merged using a binary |
97 |
package. |
98 |
@@ -73,10 +66,6 @@ package. |
99 |
\fBPKG_NOMERGE\fR = \fI"darkblue"\fR |
100 |
Defines color used for packages not planned to be merged. |
101 |
.TP |
102 |
-\fBPKG_NOMERGE_USER_SET\fR = \fI"darkblue"\fR |
103 |
-Defines color used for packages not planned to be merged from a user defined |
104 |
-set. |
105 |
-.TP |
106 |
\fBPKG_NOMERGE_SYSTEM\fR = \fI"darkblue"\fR |
107 |
Defines color used for system packages not planned to be merged. |
108 |
.TP |
109 |
|
110 |
diff --git a/man/portage.5 b/man/portage.5 |
111 |
index 3cc1f07..7c2a8f7 100644 |
112 |
--- a/man/portage.5 |
113 |
+++ b/man/portage.5 |
114 |
@@ -1114,7 +1114,6 @@ class = portage.sets.files.StaticFileSet |
115 |
multiset = true |
116 |
directory = %(PORTAGE_CONFIGROOT)setc/portage/sets |
117 |
world-candidate = True |
118 |
-user-set = True |
119 |
|
120 |
[module-rebuild] |
121 |
class = portage.sets.dbapi.OwnerSet |
122 |
|
123 |
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py |
124 |
index 7c70a3e..400617d 100644 |
125 |
--- a/pym/_emerge/resolver/output.py |
126 |
+++ b/pym/_emerge/resolver/output.py |
127 |
@@ -271,8 +271,6 @@ class Display(object): |
128 |
return colorize("PKG_BINARY_MERGE_SYSTEM", pkg_str) |
129 |
elif pkg_info.world: |
130 |
return colorize("PKG_BINARY_MERGE_WORLD", pkg_str) |
131 |
- elif pkg_info.user_set: |
132 |
- return colorize("PKG_BINARY_MERGE_USER_SET", pkg_str) |
133 |
else: |
134 |
return colorize("PKG_BINARY_MERGE", pkg_str) |
135 |
else: |
136 |
@@ -280,8 +278,6 @@ class Display(object): |
137 |
return colorize("PKG_MERGE_SYSTEM", pkg_str) |
138 |
elif pkg_info.world: |
139 |
return colorize("PKG_MERGE_WORLD", pkg_str) |
140 |
- elif pkg_info.user_set: |
141 |
- return colorize("PKG_MERGE_USER_SET", pkg_str) |
142 |
else: |
143 |
return colorize("PKG_MERGE", pkg_str) |
144 |
elif pkg_info.operation == "uninstall": |
145 |
@@ -291,8 +287,6 @@ class Display(object): |
146 |
return colorize("PKG_NOMERGE_SYSTEM", pkg_str) |
147 |
elif pkg_info.world: |
148 |
return colorize("PKG_NOMERGE_WORLD", pkg_str) |
149 |
- elif pkg_info.user_set: |
150 |
- return colorize("PKG_NOMERGE_USER_SET", pkg_str) |
151 |
else: |
152 |
return colorize("PKG_NOMERGE", pkg_str) |
153 |
|
154 |
@@ -705,21 +699,18 @@ class Display(object): |
155 |
return |
156 |
|
157 |
|
158 |
- def check_sets(self, pkg): |
159 |
- """Checks for any occurances of the package in portage sets |
160 |
+ def check_system_world(self, pkg): |
161 |
+ """Checks for any occurances of the package in the system or world sets |
162 |
|
163 |
@param pkg: _emerge.Package.Package instance |
164 |
- @rtype user_set, system, and world booleans |
165 |
+ @rtype system and world booleans |
166 |
""" |
167 |
root_config = self.conf.roots[pkg.root] |
168 |
system_set = root_config.sets["system"] |
169 |
world_set = root_config.sets["selected"] |
170 |
- user_set = None |
171 |
- system = None |
172 |
- world = None |
173 |
+ system = False |
174 |
+ world = False |
175 |
try: |
176 |
- user_set = self.conf.user_sets[pkg.root].findAtomForPackage( |
177 |
- pkg, modified_use=self.conf.pkg_use_enabled(pkg)) |
178 |
system = system_set.findAtomForPackage( |
179 |
pkg, modified_use=self.conf.pkg_use_enabled(pkg)) |
180 |
world = world_set.findAtomForPackage( |
181 |
@@ -735,7 +726,7 @@ class Display(object): |
182 |
except InvalidDependString: |
183 |
# This is reported elsewhere if relevant. |
184 |
pass |
185 |
- return user_set, system, world |
186 |
+ return system, world |
187 |
|
188 |
|
189 |
@staticmethod |
190 |
@@ -872,8 +863,8 @@ class Display(object): |
191 |
self.oldlp = self.conf.columnwidth - 30 |
192 |
self.newlp = self.oldlp - 30 |
193 |
pkg_info.oldbest = self.convert_myoldbest(pkg, pkg_info) |
194 |
- pkg_info.user_set, pkg_info.system, pkg_info.world = \ |
195 |
- self.check_sets(pkg) |
196 |
+ pkg_info.system, pkg_info.world = \ |
197 |
+ self.check_system_world(pkg) |
198 |
if 'interactive' in pkg.properties and \ |
199 |
pkg.operation == 'merge': |
200 |
pkg_info.attr_display.interactive = True |
201 |
|
202 |
diff --git a/pym/_emerge/resolver/output_helpers.py b/pym/_emerge/resolver/output_helpers.py |
203 |
index f3b2abc..70f7bc0 100644 |
204 |
--- a/pym/_emerge/resolver/output_helpers.py |
205 |
+++ b/pym/_emerge/resolver/output_helpers.py |
206 |
@@ -13,7 +13,6 @@ __all__ = ( |
207 |
import io |
208 |
import re |
209 |
import sys |
210 |
-from itertools import chain |
211 |
|
212 |
from portage import os |
213 |
from portage import _encodings, _unicode_encode |
214 |
@@ -214,14 +213,6 @@ class _DisplayConfig(object): |
215 |
self.running_root = frozen_config._running_root |
216 |
self.roots = frozen_config.roots |
217 |
|
218 |
- # Create a single merged user set for each root |
219 |
- self.user_sets = {} |
220 |
- for root_name, root in self.roots.items(): |
221 |
- self.user_sets[root_name] = InternalPackageSet(initial_atoms= \ |
222 |
- chain.from_iterable(pkgset.getAtoms() \ |
223 |
- for pkgset in root.sets.values() \ |
224 |
- if pkgset.user_set)) |
225 |
- |
226 |
self.blocker_parents = dynamic_config._blocker_parents |
227 |
self.reinstall_nodes = dynamic_config._reinstall_nodes |
228 |
self.digraph = dynamic_config.digraph |
229 |
@@ -605,8 +596,7 @@ class PkgInfo(object): |
230 |
__slots__ = ("attr_display", "built", "cp", |
231 |
"ebuild_path", "fetch_symbol", "merge", |
232 |
"oldbest", "oldbest_list", "operation", "ordered", "previous_pkg", |
233 |
- "repo_name", "repo_path_real", "user_set", "slot", "sub_slot", |
234 |
- "system", "use", "ver", "world") |
235 |
+ "repo_name", "repo_path_real", "slot", "sub_slot", "system", "use", "ver", "world") |
236 |
|
237 |
|
238 |
def __init__(self): |
239 |
@@ -622,13 +612,12 @@ class PkgInfo(object): |
240 |
self.previous_pkg = None |
241 |
self.repo_path_real = '' |
242 |
self.repo_name = '' |
243 |
- self.user_set = None |
244 |
self.slot = '' |
245 |
self.sub_slot = '' |
246 |
- self.system = None |
247 |
+ self.system = False |
248 |
self.use = '' |
249 |
self.ver = '' |
250 |
- self.world = None |
251 |
+ self.world = False |
252 |
self.attr_display = PkgAttrDisplay() |
253 |
|
254 |
class PkgAttrDisplay(SlotObject): |
255 |
|
256 |
diff --git a/pym/portage/_sets/__init__.py b/pym/portage/_sets/__init__.py |
257 |
index 6d69bda..2c9bf97 100644 |
258 |
--- a/pym/portage/_sets/__init__.py |
259 |
+++ b/pym/portage/_sets/__init__.py |
260 |
@@ -117,7 +117,6 @@ class SetConfig(object): |
261 |
parser.set("usersets", "multiset", "true") |
262 |
parser.set("usersets", "directory", "%(PORTAGE_CONFIGROOT)setc/portage/sets") |
263 |
parser.set("usersets", "world-candidate", "true") |
264 |
- parser.set("usersets", "user-set", "true") |
265 |
|
266 |
parser.remove_section("live-rebuild") |
267 |
parser.add_section("live-rebuild") |
268 |
@@ -146,7 +145,6 @@ class SetConfig(object): |
269 |
if not setname in self.psets: |
270 |
options["name"] = setname |
271 |
options["world-candidate"] = "False" |
272 |
- options["user-set"] = "False" |
273 |
|
274 |
# for the unlikely case that there is already a section with the requested setname |
275 |
import random |
276 |
@@ -215,9 +213,6 @@ class SetConfig(object): |
277 |
if parser.has_option(sname, "world-candidate") and \ |
278 |
parser.getboolean(sname, "world-candidate"): |
279 |
newsets[x].world_candidate = True |
280 |
- if parser.has_option(sname, "user-set") and \ |
281 |
- parser.getboolean(sname, "user-set"): |
282 |
- newsets[x].user_set = True |
283 |
self.psets.update(newsets) |
284 |
else: |
285 |
self.errors.append(_("Section '%(section)s' is configured as multiset, but '%(class)s' " |
286 |
@@ -237,9 +232,6 @@ class SetConfig(object): |
287 |
if parser.has_option(sname, "world-candidate") and \ |
288 |
parser.getboolean(sname, "world-candidate"): |
289 |
self.psets[setname].world_candidate = True |
290 |
- if parser.has_option(sname, "user-set") and \ |
291 |
- parser.getboolean(sname, "user-set"): |
292 |
- self.psets[setname].user_set = True |
293 |
except SetConfigError as e: |
294 |
self.errors.append(_("Configuration error in section '%s': %s") % (sname, str(e))) |
295 |
continue |
296 |
|
297 |
diff --git a/pym/portage/_sets/base.py b/pym/portage/_sets/base.py |
298 |
index 7be9aab..ee20d36 100644 |
299 |
--- a/pym/portage/_sets/base.py |
300 |
+++ b/pym/portage/_sets/base.py |
301 |
@@ -28,7 +28,6 @@ class PackageSet(object): |
302 |
self.errors = [] |
303 |
self._nonatoms = set() |
304 |
self.world_candidate = False |
305 |
- self.user_set = False |
306 |
self._allow_wildcard = allow_wildcard |
307 |
self._allow_repo = allow_repo |
308 |
|
309 |
|
310 |
diff --git a/pym/portage/output.py b/pym/portage/output.py |
311 |
index 80c67e8..bb7542b 100644 |
312 |
--- a/pym/portage/output.py |
313 |
+++ b/pym/portage/output.py |
314 |
@@ -128,27 +128,24 @@ _styles["HILITE"] = ( "teal", ) |
315 |
_styles["BRACKET"] = ( "blue", ) |
316 |
|
317 |
# Portage functions |
318 |
-_styles["INFORM"] = ( "darkgreen", ) |
319 |
-_styles["UNMERGE_WARN"] = ( "red", ) |
320 |
-_styles["SECURITY_WARN"] = ( "red", ) |
321 |
-_styles["MERGE_LIST_PROGRESS"] = ( "yellow", ) |
322 |
-_styles["PKG_BLOCKER"] = ( "red", ) |
323 |
-_styles["PKG_BLOCKER_SATISFIED"] = ( "darkblue", ) |
324 |
-_styles["PKG_MERGE"] = ( "darkgreen", ) |
325 |
-_styles["PKG_MERGE_USER_SET"] = ( "darkgreen", ) |
326 |
-_styles["PKG_MERGE_SYSTEM"] = ( "darkgreen", ) |
327 |
-_styles["PKG_MERGE_WORLD"] = ( "green", ) |
328 |
-_styles["PKG_BINARY_MERGE"] = ( "purple", ) |
329 |
-_styles["PKG_BINARY_MERGE_USER_SET"] = ( "purple", ) |
330 |
-_styles["PKG_BINARY_MERGE_SYSTEM"] = ( "purple", ) |
331 |
-_styles["PKG_BINARY_MERGE_WORLD"] = ( "fuchsia", ) |
332 |
-_styles["PKG_UNINSTALL"] = ( "red", ) |
333 |
-_styles["PKG_NOMERGE"] = ( "darkblue", ) |
334 |
-_styles["PKG_NOMERGE_USER_SET"] = ( "darkblue", ) |
335 |
-_styles["PKG_NOMERGE_SYSTEM"] = ( "darkblue", ) |
336 |
-_styles["PKG_NOMERGE_WORLD"] = ( "blue", ) |
337 |
-_styles["PROMPT_CHOICE_DEFAULT"] = ( "green", ) |
338 |
-_styles["PROMPT_CHOICE_OTHER"] = ( "red", ) |
339 |
+_styles["INFORM"] = ( "darkgreen", ) |
340 |
+_styles["UNMERGE_WARN"] = ( "red", ) |
341 |
+_styles["SECURITY_WARN"] = ( "red", ) |
342 |
+_styles["MERGE_LIST_PROGRESS"] = ( "yellow", ) |
343 |
+_styles["PKG_BLOCKER"] = ( "red", ) |
344 |
+_styles["PKG_BLOCKER_SATISFIED"] = ( "darkblue", ) |
345 |
+_styles["PKG_MERGE"] = ( "darkgreen", ) |
346 |
+_styles["PKG_MERGE_SYSTEM"] = ( "darkgreen", ) |
347 |
+_styles["PKG_MERGE_WORLD"] = ( "green", ) |
348 |
+_styles["PKG_BINARY_MERGE"] = ( "purple", ) |
349 |
+_styles["PKG_BINARY_MERGE_SYSTEM"] = ( "purple", ) |
350 |
+_styles["PKG_BINARY_MERGE_WORLD"] = ( "fuchsia", ) |
351 |
+_styles["PKG_UNINSTALL"] = ( "red", ) |
352 |
+_styles["PKG_NOMERGE"] = ( "darkblue", ) |
353 |
+_styles["PKG_NOMERGE_SYSTEM"] = ( "darkblue", ) |
354 |
+_styles["PKG_NOMERGE_WORLD"] = ( "blue", ) |
355 |
+_styles["PROMPT_CHOICE_DEFAULT"] = ( "green", ) |
356 |
+_styles["PROMPT_CHOICE_OTHER"] = ( "red", ) |
357 |
|
358 |
def _parse_color_map(config_root='/', onerror=None): |
359 |
""" |