aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2018-06-05 13:41:40 -0700
committerZac Medico <zmedico@gentoo.org>2018-06-05 13:41:40 -0700
commite8067a8e6fbdaccca5915e66c77518e82b090401 (patch)
treef97948ef6cfe5be84e40050dcd215e56aeff5fd4
parentemerge -pf: spawn pkg_nofetch asynchronously (bug 657360) (diff)
downloadportage-e8067a8e6fbdaccca5915e66c77518e82b090401.tar.gz
portage-e8067a8e6fbdaccca5915e66c77518e82b090401.tar.bz2
portage-e8067a8e6fbdaccca5915e66c77518e82b090401.zip
emerge --depclean: 'str' has no attribute 'soname' (bug 657420)
Convert str to Atom, in order to avoid an AttributeError in the DbapiProvidesIndex.match method. Also, add comment explaining the reason for _unicode(atom) usage here, since it's not obvious. Bug: https://bugs.gentoo.org/657420
-rw-r--r--pym/_emerge/actions.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 70fb8d3b4..f7232341d 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -944,8 +944,23 @@ def calc_depclean(settings, trees, ldpath_mtimes,
msg.append("the following required packages not being installed:")
msg.append("")
for atom, parent in unresolvable:
+ # For readability, we want to display the atom with USE
+ # conditionals evaluated whenever possible. However,
+ # there is a very special case where the atom does not
+ # match because the unevaluated form contains one or
+ # more flags for which the target package has missing
+ # IUSE, but due to conditionals those flags are only
+ # visible in the unevaluated form of the atom. In this
+ # case, we must display the unevaluated atom, so that
+ # the user can see the conditional USE deps that would
+ # otherwise be invisible. Use Atom(_unicode(atom)) to
+ # test for a package where this case would matter. This
+ # is not necessarily the same as atom.without_use,
+ # since Atom(_unicode(atom)) may still contain some
+ # USE dependencies that remain after evaluation of
+ # conditionals.
if atom.package and atom != atom.unevaluated_atom and \
- vardb.match(_unicode(atom)):
+ vardb.match(Atom(_unicode(atom))):
msg.append(" %s (%s) pulled in by:" %
(atom.unevaluated_atom, atom))
else: