aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Mills <adam@armills.info>2016-05-25 12:12:56 -0400
committerAlexander Berntsen <bernalex@gentoo.org>2016-05-27 10:22:48 +0200
commita91492450d86abb34bbd05ccaf0e60d8b1c973a0 (patch)
tree40684f532629d50e8646f2e1de5bf53d301adec7
parentportage.util.configparser: Commonize portable config file reading routine (diff)
downloadportage-a91492450d86abb34bbd05ccaf0e60d8b1c973a0.tar.gz
portage-a91492450d86abb34bbd05ccaf0e60d8b1c973a0.tar.bz2
portage-a91492450d86abb34bbd05ccaf0e60d8b1c973a0.zip
Revert "Colorize packages in user sets (bug 577720)"
This reverts commit 739845a6eab95fbc44eab1b7b938c860563631d7. The feature implemented in this commit for bug 577720 was determined to be an overcomplicated method of colorizing user sets. Instead, this feature will be implemented as in bug 583164. The configuration options implemented in this reverted commit will be removed. Per bug 583164, packages that belong to a set listed in world_sets will be colorized as world packages. This eliminates the extra configuration and associated complications. See bug 583164 for more details. Acked-by: Alexander Berntsen <bernalex@gentoo.org> Acked-by: Zac Medico <zmedico@gentoo.org Signed-off-by: Alexander Berntsen <bernalex@gentoo.org>
-rw-r--r--cnf/sets/portage.conf1
-rw-r--r--doc/config/sets.docbook4
-rw-r--r--man/color.map.511
-rw-r--r--man/portage.51
-rw-r--r--pym/_emerge/resolver/output.py25
-rw-r--r--pym/_emerge/resolver/output_helpers.py17
-rw-r--r--pym/portage/_sets/__init__.py8
-rw-r--r--pym/portage/_sets/base.py1
-rw-r--r--pym/portage/output.py39
9 files changed, 30 insertions, 77 deletions
diff --git a/cnf/sets/portage.conf b/cnf/sets/portage.conf
index e99062005..ac282d911 100644
--- a/cnf/sets/portage.conf
+++ b/cnf/sets/portage.conf
@@ -49,7 +49,6 @@ class = portage.sets.files.StaticFileSet
multiset = true
directory = %(PORTAGE_CONFIGROOT)setc/portage/sets
world-candidate = True
-user-set = True
# Set to rebuild all packages that need a preserved lib that only remains due
# to FEATURES=preserve-libs
diff --git a/doc/config/sets.docbook b/doc/config/sets.docbook
index 02135d680..749b7753a 100644
--- a/doc/config/sets.docbook
+++ b/doc/config/sets.docbook
@@ -57,8 +57,6 @@
is missing)</para></listitem>
<listitem><para><varname>world-candidate</varname>, which determines if
given package should be added to the <varname>world</varname> set</para></listitem>
- <listitem><para><varname>user-set</varname>, which determines if
- given package should be colorized as a user set</para></listitem>
</itemizedlist>
<para>
Some handler classes might require additional options for their configuration,
@@ -95,7 +93,7 @@
but to indicate that the section should generate multiple sets it's
also necessary to set the <varname>multiset</varname> option to
<parameter>true</parameter>. The <varname>world-candidate</varname>
- and <varname>user-set</varname> options are also supported like with
+ option also supported like with
single sets (they'll apply to all sets generated by the section).
</para>
<para>
diff --git a/man/color.map.5 b/man/color.map.5
index 39f23f7f5..5543628f8 100644
--- a/man/color.map.5
+++ b/man/color.map.5
@@ -46,9 +46,6 @@ Defines color used for satisfied blockers.
\fBPKG_MERGE\fR = \fI"darkgreen"\fR
Defines color used for packages planned to be merged.
.TP
-\fBPKG_MERGE_USER_SET\fR = \fI"darkgreen"\fR
-Defines color used for packages planned to be merged from a user defined set.
-.TP
\fBPKG_MERGE_SYSTEM\fR = \fI"darkgreen"\fR
Defines color used for system packages planned to be merged.
.TP
@@ -58,10 +55,6 @@ Defines color used for world packages planned to be merged.
\fBPKG_BINARY_MERGE\fR = \fI"purple"\fR
Defines color used for packages planned to be merged using a binary package.
.TP
-\fBPKG_BINARY_MERGE_USER_SET\fR = \fI"purple"\fR
-Defines color used for packages planned to be merged using a binary package
-from a user defined set.
-.TP
\fBPKG_BINARY_MERGE_SYSTEM\fR = \fI"purple"\fR
Defines color used for system packages planned to be merged using a binary
package.
@@ -73,10 +66,6 @@ package.
\fBPKG_NOMERGE\fR = \fI"darkblue"\fR
Defines color used for packages not planned to be merged.
.TP
-\fBPKG_NOMERGE_USER_SET\fR = \fI"darkblue"\fR
-Defines color used for packages not planned to be merged from a user defined
-set.
-.TP
\fBPKG_NOMERGE_SYSTEM\fR = \fI"darkblue"\fR
Defines color used for system packages not planned to be merged.
.TP
diff --git a/man/portage.5 b/man/portage.5
index 3cc1f0797..7c2a8f74e 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -1114,7 +1114,6 @@ class = portage.sets.files.StaticFileSet
multiset = true
directory = %(PORTAGE_CONFIGROOT)setc/portage/sets
world-candidate = True
-user-set = True
[module-rebuild]
class = portage.sets.dbapi.OwnerSet
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index 7c70a3e51..400617de0 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -271,8 +271,6 @@ class Display(object):
return colorize("PKG_BINARY_MERGE_SYSTEM", pkg_str)
elif pkg_info.world:
return colorize("PKG_BINARY_MERGE_WORLD", pkg_str)
- elif pkg_info.user_set:
- return colorize("PKG_BINARY_MERGE_USER_SET", pkg_str)
else:
return colorize("PKG_BINARY_MERGE", pkg_str)
else:
@@ -280,8 +278,6 @@ class Display(object):
return colorize("PKG_MERGE_SYSTEM", pkg_str)
elif pkg_info.world:
return colorize("PKG_MERGE_WORLD", pkg_str)
- elif pkg_info.user_set:
- return colorize("PKG_MERGE_USER_SET", pkg_str)
else:
return colorize("PKG_MERGE", pkg_str)
elif pkg_info.operation == "uninstall":
@@ -291,8 +287,6 @@ class Display(object):
return colorize("PKG_NOMERGE_SYSTEM", pkg_str)
elif pkg_info.world:
return colorize("PKG_NOMERGE_WORLD", pkg_str)
- elif pkg_info.user_set:
- return colorize("PKG_NOMERGE_USER_SET", pkg_str)
else:
return colorize("PKG_NOMERGE", pkg_str)
@@ -705,21 +699,18 @@ class Display(object):
return
- def check_sets(self, pkg):
- """Checks for any occurances of the package in portage sets
+ def check_system_world(self, pkg):
+ """Checks for any occurances of the package in the system or world sets
@param pkg: _emerge.Package.Package instance
- @rtype user_set, system, and world booleans
+ @rtype system and world booleans
"""
root_config = self.conf.roots[pkg.root]
system_set = root_config.sets["system"]
world_set = root_config.sets["selected"]
- user_set = None
- system = None
- world = None
+ system = False
+ world = False
try:
- user_set = self.conf.user_sets[pkg.root].findAtomForPackage(
- pkg, modified_use=self.conf.pkg_use_enabled(pkg))
system = system_set.findAtomForPackage(
pkg, modified_use=self.conf.pkg_use_enabled(pkg))
world = world_set.findAtomForPackage(
@@ -735,7 +726,7 @@ class Display(object):
except InvalidDependString:
# This is reported elsewhere if relevant.
pass
- return user_set, system, world
+ return system, world
@staticmethod
@@ -872,8 +863,8 @@ class Display(object):
self.oldlp = self.conf.columnwidth - 30
self.newlp = self.oldlp - 30
pkg_info.oldbest = self.convert_myoldbest(pkg, pkg_info)
- pkg_info.user_set, pkg_info.system, pkg_info.world = \
- self.check_sets(pkg)
+ pkg_info.system, pkg_info.world = \
+ self.check_system_world(pkg)
if 'interactive' in pkg.properties and \
pkg.operation == 'merge':
pkg_info.attr_display.interactive = True
diff --git a/pym/_emerge/resolver/output_helpers.py b/pym/_emerge/resolver/output_helpers.py
index f3b2abc4d..70f7bc090 100644
--- a/pym/_emerge/resolver/output_helpers.py
+++ b/pym/_emerge/resolver/output_helpers.py
@@ -13,7 +13,6 @@ __all__ = (
import io
import re
import sys
-from itertools import chain
from portage import os
from portage import _encodings, _unicode_encode
@@ -214,14 +213,6 @@ class _DisplayConfig(object):
self.running_root = frozen_config._running_root
self.roots = frozen_config.roots
- # Create a single merged user set for each root
- self.user_sets = {}
- for root_name, root in self.roots.items():
- self.user_sets[root_name] = InternalPackageSet(initial_atoms= \
- chain.from_iterable(pkgset.getAtoms() \
- for pkgset in root.sets.values() \
- if pkgset.user_set))
-
self.blocker_parents = dynamic_config._blocker_parents
self.reinstall_nodes = dynamic_config._reinstall_nodes
self.digraph = dynamic_config.digraph
@@ -605,8 +596,7 @@ class PkgInfo(object):
__slots__ = ("attr_display", "built", "cp",
"ebuild_path", "fetch_symbol", "merge",
"oldbest", "oldbest_list", "operation", "ordered", "previous_pkg",
- "repo_name", "repo_path_real", "user_set", "slot", "sub_slot",
- "system", "use", "ver", "world")
+ "repo_name", "repo_path_real", "slot", "sub_slot", "system", "use", "ver", "world")
def __init__(self):
@@ -622,13 +612,12 @@ class PkgInfo(object):
self.previous_pkg = None
self.repo_path_real = ''
self.repo_name = ''
- self.user_set = None
self.slot = ''
self.sub_slot = ''
- self.system = None
+ self.system = False
self.use = ''
self.ver = ''
- self.world = None
+ self.world = False
self.attr_display = PkgAttrDisplay()
class PkgAttrDisplay(SlotObject):
diff --git a/pym/portage/_sets/__init__.py b/pym/portage/_sets/__init__.py
index 6d69bdac0..2c9bf9715 100644
--- a/pym/portage/_sets/__init__.py
+++ b/pym/portage/_sets/__init__.py
@@ -117,7 +117,6 @@ class SetConfig(object):
parser.set("usersets", "multiset", "true")
parser.set("usersets", "directory", "%(PORTAGE_CONFIGROOT)setc/portage/sets")
parser.set("usersets", "world-candidate", "true")
- parser.set("usersets", "user-set", "true")
parser.remove_section("live-rebuild")
parser.add_section("live-rebuild")
@@ -146,7 +145,6 @@ class SetConfig(object):
if not setname in self.psets:
options["name"] = setname
options["world-candidate"] = "False"
- options["user-set"] = "False"
# for the unlikely case that there is already a section with the requested setname
import random
@@ -215,9 +213,6 @@ class SetConfig(object):
if parser.has_option(sname, "world-candidate") and \
parser.getboolean(sname, "world-candidate"):
newsets[x].world_candidate = True
- if parser.has_option(sname, "user-set") and \
- parser.getboolean(sname, "user-set"):
- newsets[x].user_set = True
self.psets.update(newsets)
else:
self.errors.append(_("Section '%(section)s' is configured as multiset, but '%(class)s' "
@@ -237,9 +232,6 @@ class SetConfig(object):
if parser.has_option(sname, "world-candidate") and \
parser.getboolean(sname, "world-candidate"):
self.psets[setname].world_candidate = True
- if parser.has_option(sname, "user-set") and \
- parser.getboolean(sname, "user-set"):
- self.psets[setname].user_set = True
except SetConfigError as e:
self.errors.append(_("Configuration error in section '%s': %s") % (sname, str(e)))
continue
diff --git a/pym/portage/_sets/base.py b/pym/portage/_sets/base.py
index 7be9aab43..ee20d3671 100644
--- a/pym/portage/_sets/base.py
+++ b/pym/portage/_sets/base.py
@@ -28,7 +28,6 @@ class PackageSet(object):
self.errors = []
self._nonatoms = set()
self.world_candidate = False
- self.user_set = False
self._allow_wildcard = allow_wildcard
self._allow_repo = allow_repo
diff --git a/pym/portage/output.py b/pym/portage/output.py
index 80c67e82a..bb7542bbf 100644
--- a/pym/portage/output.py
+++ b/pym/portage/output.py
@@ -128,27 +128,24 @@ _styles["HILITE"] = ( "teal", )
_styles["BRACKET"] = ( "blue", )
# Portage functions
-_styles["INFORM"] = ( "darkgreen", )
-_styles["UNMERGE_WARN"] = ( "red", )
-_styles["SECURITY_WARN"] = ( "red", )
-_styles["MERGE_LIST_PROGRESS"] = ( "yellow", )
-_styles["PKG_BLOCKER"] = ( "red", )
-_styles["PKG_BLOCKER_SATISFIED"] = ( "darkblue", )
-_styles["PKG_MERGE"] = ( "darkgreen", )
-_styles["PKG_MERGE_USER_SET"] = ( "darkgreen", )
-_styles["PKG_MERGE_SYSTEM"] = ( "darkgreen", )
-_styles["PKG_MERGE_WORLD"] = ( "green", )
-_styles["PKG_BINARY_MERGE"] = ( "purple", )
-_styles["PKG_BINARY_MERGE_USER_SET"] = ( "purple", )
-_styles["PKG_BINARY_MERGE_SYSTEM"] = ( "purple", )
-_styles["PKG_BINARY_MERGE_WORLD"] = ( "fuchsia", )
-_styles["PKG_UNINSTALL"] = ( "red", )
-_styles["PKG_NOMERGE"] = ( "darkblue", )
-_styles["PKG_NOMERGE_USER_SET"] = ( "darkblue", )
-_styles["PKG_NOMERGE_SYSTEM"] = ( "darkblue", )
-_styles["PKG_NOMERGE_WORLD"] = ( "blue", )
-_styles["PROMPT_CHOICE_DEFAULT"] = ( "green", )
-_styles["PROMPT_CHOICE_OTHER"] = ( "red", )
+_styles["INFORM"] = ( "darkgreen", )
+_styles["UNMERGE_WARN"] = ( "red", )
+_styles["SECURITY_WARN"] = ( "red", )
+_styles["MERGE_LIST_PROGRESS"] = ( "yellow", )
+_styles["PKG_BLOCKER"] = ( "red", )
+_styles["PKG_BLOCKER_SATISFIED"] = ( "darkblue", )
+_styles["PKG_MERGE"] = ( "darkgreen", )
+_styles["PKG_MERGE_SYSTEM"] = ( "darkgreen", )
+_styles["PKG_MERGE_WORLD"] = ( "green", )
+_styles["PKG_BINARY_MERGE"] = ( "purple", )
+_styles["PKG_BINARY_MERGE_SYSTEM"] = ( "purple", )
+_styles["PKG_BINARY_MERGE_WORLD"] = ( "fuchsia", )
+_styles["PKG_UNINSTALL"] = ( "red", )
+_styles["PKG_NOMERGE"] = ( "darkblue", )
+_styles["PKG_NOMERGE_SYSTEM"] = ( "darkblue", )
+_styles["PKG_NOMERGE_WORLD"] = ( "blue", )
+_styles["PROMPT_CHOICE_DEFAULT"] = ( "green", )
+_styles["PROMPT_CHOICE_OTHER"] = ( "red", )
def _parse_color_map(config_root='/', onerror=None):
"""