aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2019-12-14 21:30:13 -0800
committerZac Medico <zmedico@gentoo.org>2019-12-14 22:27:26 -0800
commit463b2d36f3d95760e48543f1f30410aa76267538 (patch)
tree55db0f40c42738cf3eb3245c62a2bceaf927467b
parentemerge-delta-webrsync: handle gentoo-YYYYMMDD directory name (diff)
downloadportage-463b2d36f3d95760e48543f1f30410aa76267538.tar.gz
portage-463b2d36f3d95760e48543f1f30410aa76267538.tar.bz2
portage-463b2d36f3d95760e48543f1f30410aa76267538.zip
emerge: Show package USE in conflict messages
Bug: https://bugs.gentoo.org/310009 Signed-off-by: Zac Medico <zmedico@gentoo.org>
-rw-r--r--lib/_emerge/depgraph.py26
-rw-r--r--lib/_emerge/resolver/slot_collision.py17
2 files changed, 34 insertions, 9 deletions
diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py
index 02e0e075d..1a5448c8f 100644
--- a/lib/_emerge/depgraph.py
+++ b/lib/_emerge/depgraph.py
@@ -1285,7 +1285,10 @@ class depgraph(object):
msg.append("\n\n")
msg.append(indent)
- msg.append(str(pkg))
+ msg.append("%s %s" % (pkg,
+ pkg_use_display(pkg,
+ self._frozen_config.myopts,
+ modified_use=self._pkg_use_enabled(pkg))))
msg.append(" conflicts with\n")
for parent, atom in parent_atoms:
@@ -1302,8 +1305,15 @@ class depgraph(object):
atom, marker = format_unmatched_atom(
pkg, atom, self._pkg_use_enabled)
+ if isinstance(parent, Package):
+ use_display = pkg_use_display(parent,
+ self._frozen_config.myopts,
+ modified_use=self._pkg_use_enabled(parent))
+ else:
+ use_display = ""
+
msg.append(2*indent)
- msg.append("%s required by %s\n" % (atom, parent))
+ msg.append("%s required by %s %s\n" % (atom, parent, use_display))
msg.append(2*indent)
msg.append(marker)
msg.append("\n")
@@ -8472,14 +8482,20 @@ class depgraph(object):
else:
# Display the specific atom from SetArg or
# Package types.
+ if isinstance(parent, Package):
+ use_display = pkg_use_display(parent,
+ self._frozen_config.myopts,
+ modified_use=self._pkg_use_enabled(parent))
+ else:
+ use_display = ""
if atom.package and atom != atom.unevaluated_atom:
# Show the unevaluated atom, since it can reveal
# issues with conditional use-flags missing
# from IUSE.
- msg.append("%s (%s) required by %s" %
- (atom.unevaluated_atom, atom, parent))
+ msg.append("%s (%s) required by %s %s" %
+ (atom.unevaluated_atom, atom, parent, use_display))
else:
- msg.append("%s required by %s" % (atom, parent))
+ msg.append("%s required by %s %s" % (atom, parent, use_display))
msg.append("\n")
msg.append("\n")
diff --git a/lib/_emerge/resolver/slot_collision.py b/lib/_emerge/resolver/slot_collision.py
index f676b38c8..682a3a0a5 100644
--- a/lib/_emerge/resolver/slot_collision.py
+++ b/lib/_emerge/resolver/slot_collision.py
@@ -9,6 +9,7 @@ from portage import _encodings, _unicode_encode
from _emerge.AtomArg import AtomArg
from _emerge.Package import Package
from _emerge.PackageArg import PackageArg
+from _emerge.UseFlagDisplay import pkg_use_display
from portage.dep import check_required_use
from portage.output import colorize
from portage._sets.base import InternalPackageSet
@@ -260,7 +261,9 @@ class slot_conflict_handler(object):
for pkg in pkgs:
msg.append(indent)
- msg.append("%s" % (pkg,))
+ msg.append("%s %s" % (pkg, pkg_use_display(pkg,
+ self.depgraph._frozen_config.myopts,
+ modified_use=self.depgraph._pkg_use_enabled(pkg))))
parent_atoms = self.all_parents.get(pkg)
if parent_atoms:
#Create a list of collision reasons and map them to sets
@@ -569,9 +572,15 @@ class slot_conflict_handler(object):
ordered_list.append(parent_atom)
for parent_atom in ordered_list:
parent, atom = parent_atom
+ if isinstance(parent, Package):
+ use_display = pkg_use_display(parent,
+ self.depgraph._frozen_config.myopts,
+ modified_use=self.depgraph._pkg_use_enabled(parent))
+ else:
+ use_display = ""
if atom.soname:
- msg.append("%s required by %s\n" %
- (atom, parent))
+ msg.append("%s required by %s %s\n" %
+ (atom, parent, use_display))
elif isinstance(parent, PackageArg):
# For PackageArg it's
# redundant to display the atom attribute.
@@ -602,7 +611,7 @@ class slot_conflict_handler(object):
if version_violated or slot_violated:
self.is_a_version_conflict = True
- cur_line = "%s required by %s\n" % (atom_str, parent)
+ cur_line = "%s required by %s %s\n" % (atom_str, parent, use_display)
marker_line = ""
for ii in range(len(cur_line)):
if ii in colored_idx: