commit:     9cce0dad3f45b15f8f069a552ac6c91b9dfdd769
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Fri Jan 18 08:42:09 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jan 20 07:05:17 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=9cce0dad

emerge: compare new slot USE to installed slot

For new-slot package installation, show USE flags added/deleted in
comparison with highest installed other-slot package instance

Bug: https://bugs.gentoo.org/675756
Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/_emerge/resolver/output.py | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/lib/_emerge/resolver/output.py b/lib/_emerge/resolver/output.py
index 24340576c..ed88cc51f 100644
--- a/lib/_emerge/resolver/output.py
+++ b/lib/_emerge/resolver/output.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2018 Gentoo Foundation
+# Copyright 2010-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 """Resolver output display operation.
@@ -673,9 +673,14 @@ class Display(object):
                        pkg_info.previous_pkg = self.vardb.match_pkgs(
                                Atom('=' + pkg.cpv))[0]
                else:
-                       slot_matches = self.vardb.match_pkgs(pkg.slot_atom)
-                       if slot_matches:
-                               pkg_info.previous_pkg = slot_matches[0]
+                       cp_slot_matches = self.vardb.match_pkgs(pkg.slot_atom)
+                       if cp_slot_matches:
+                               pkg_info.previous_pkg = cp_slot_matches[0]
+                       else:
+                               cp_matches = self.vardb.match_pkgs(Atom(pkg.cp))
+                               if cp_matches:
+                                       # Use highest installed other-slot 
package instance.
+                                       pkg_info.previous_pkg = cp_matches[-1]
 
                return pkg_info
 

Reply via email to