Bug #267468 - Display the total number of binary packages in the merge
authorZac Medico <zmedico@gentoo.org>
Fri, 9 Oct 2009 06:54:03 +0000 (06:54 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 9 Oct 2009 06:54:03 +0000 (06:54 -0000)
list. Thanks to Sebastian Mingramm (few) for this patch.

svn path=/main/trunk/; revision=14520

pym/_emerge/PackageCounters.py
pym/_emerge/depgraph.py

index 9da79d38994b9dd1ff94b2ff78e41008cc7e3c41..e99972e6f7ef8efb9bb7a938c6d89b915461b462 100644 (file)
@@ -22,6 +22,7 @@ class PackageCounters(object):
                self.restrict_fetch           = 0
                self.restrict_fetch_satisfied = 0
                self.interactive              = 0
+               self.binary                   = 0
 
        def __str__(self):
                total_installs = self.upgrades + self.downgrades + self.newslot + self.new + self.reinst
@@ -50,6 +51,10 @@ class PackageCounters(object):
                        details.append("%s reinstall" % self.reinst)
                        if self.reinst > 1:
                                details[-1] += "s"
+               if self.binary > 0:
+                       details.append("%s binary" % self.binary)
+                       if self.binary > 1:
+                               details[-1] = details[-1][:-1] + "ies"
                if self.uninst > 0:
                        details.append("%s uninstall" % self.uninst)
                        if self.uninst > 1:
index 2cc9e170afa290bba83e2cd2912b17c5160995a0..c384b5866a2575f9a0fd987af947ab02f85c29f2 100644 (file)
@@ -4161,6 +4161,8 @@ class depgraph(object):
                                        if ordered:
                                                if pkg_merge:
                                                        counters.reinst += 1
+                                                       if pkg_type == "binary":
+                                                               counters.binary += 1
                                                elif pkg_status == "uninstall":
                                                        counters.uninst += 1
                                # filter out old-style virtual matches
@@ -4183,17 +4185,23 @@ class depgraph(object):
                                                        addl += turquoise("U")+blue("D")
                                                        if ordered:
                                                                counters.downgrades += 1
+                                                               if pkg_type == "binary":
+                                                                       counters.binary += 1
                                                else:
                                                        # Update in slot
                                                        addl += turquoise("U") + " "
                                                        if ordered:
                                                                counters.upgrades += 1
+                                                               if pkg_type == "binary":
+                                                                       counters.binary += 1
                                        else:
                                                # New slot, mark it new.
                                                addl = " " + green("NS") + fetch + "  "
                                                myoldbest = vardb.match(portage.cpv_getkey(pkg_key))
                                                if ordered:
                                                        counters.newslot += 1
+                                                       if pkg_type == "binary":
+                                                               counters.binary += 1
 
                                        if "--changelog" in self._frozen_config.myopts:
                                                inst_matches = vardb.match(pkg.slot_atom)
@@ -4210,6 +4218,8 @@ class depgraph(object):
                                        addl = " " + green("N") + " " + fetch + "  "
                                        if ordered:
                                                counters.new += 1
+                                               if pkg_type == "binary":
+                                                       counters.binary += 1
 
                                verboseadd = ""
                                repoadd = None