Gentoo Archives: gentoo-portage-dev

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

Replies

Subject Author
[gentoo-portage-dev] [PATCH v2 2/2] Colorize packages in world_sets (bug 583164) Adam Mills <adam@×××××××.info>