commit:     e8067a8e6fbdaccca5915e66c77518e82b090401
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jun  5 20:41:40 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jun  5 20:41:40 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=e8067a8e

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

 pym/_emerge/actions.py | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

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:

Reply via email to