merge list: distinguish reinstall with red "r"
authorZac Medico <zmedico@gentoo.org>
Fri, 14 Sep 2012 01:37:19 +0000 (18:37 -0700)
committerZac Medico <zmedico@gentoo.org>
Fri, 14 Sep 2012 01:37:19 +0000 (18:37 -0700)
This is for reinstall due to slot or sub-slot change of a dependency
when the := slot operator is used.

man/emerge.1
pym/_emerge/resolver/output.py
pym/_emerge/resolver/output_helpers.py

index 65eefa2..8474cf9 100644 (file)
@@ -619,7 +619,8 @@ N   new (not yet installed)
 S      new SLOT installation (side-by-side versions) 
 U      updating (to another version)
 D      downgrading (best version seems lower)
-R      replacing (remerging same version))
+r      reinstall (forced due to slot or sub\-slot change of a dependency)
+R      replacing (remerging same version)
 F      fetch restricted (must be manually downloaded)
 f      fetch restricted (already downloaded)
 I      interactive (requires user input)
index 11e668b..3325a42 100644 (file)
@@ -790,6 +790,13 @@ class Display(object):
                                pkg_info = self.set_pkg_info(pkg, ordered)
                                pkg_info.oldbest_list, myinslotlist = \
                                        self._get_installed_best(pkg, pkg_info)
+                               if ordered and pkg_info.merge and \
+                                       not pkg_info.attr_display.new:
+                                       for arg, atom in depgraph._iter_atoms_for_pkg(pkg):
+                                               if arg.force_reinstall:
+                                                       pkg_info.attr_display.force_reinstall = True
+                                                       break
+
                                self.verboseadd = ""
                                if self.quiet_repo_display:
                                        self.repoadd = None
index 41dc324..be4ea4a 100644 (file)
@@ -641,6 +641,7 @@ class PkgInfo(object):
 class PkgAttrDisplay(SlotObject):
 
        __slots__ = ("downgrade", "fetch_restrict", "fetch_restrict_satisfied",
+               "force_reinstall",
                "interactive", "mask", "new", "new_slot", "new_version", "replace")
 
        def __str__(self):
@@ -651,8 +652,11 @@ class PkgAttrDisplay(SlotObject):
                else:
                        output.append(" ")
 
-               if self.new:
-                       output.append(green("N"))
+               if self.new or self.force_reinstall:
+                       if self.force_reinstall:
+                               output.append(red("r"))
+                       else:
+                               output.append(green("N"))
                else:
                        output.append(" ")