MergeListItem: color binary display, bug #438254
authorZac Medico <zmedico@gentoo.org>
Sat, 13 Oct 2012 20:06:05 +0000 (13:06 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 13 Oct 2012 20:06:05 +0000 (13:06 -0700)
pym/_emerge/MergeListItem.py
pym/_emerge/PackageMerge.py

index 8086c689a6e3a6fa88bbd077989b310240eefacf..4ce2cd17f573b5fd4311ab417397227b4cfa6260 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from portage import os
@@ -47,8 +47,10 @@ class MergeListItem(CompositeTask):
 
                action_desc = "Emerging"
                preposition = "for"
+               pkg_color = "PKG_MERGE"
                if pkg.type_name == "binary":
-                       action_desc += " binary"
+                       pkg_color = "PKG_BINARY_MERGE"
+                       action_desc += " " + colorize(pkg_color, "binary")
 
                if build_opts.fetchonly:
                        action_desc = "Fetching"
@@ -57,7 +59,7 @@ class MergeListItem(CompositeTask):
                        (action_desc,
                        colorize("MERGE_LIST_PROGRESS", str(pkg_count.curval)),
                        colorize("MERGE_LIST_PROGRESS", str(pkg_count.maxval)),
-                       colorize("GOOD", pkg.cpv))
+                       colorize(pkg_color, pkg.cpv))
 
                portdb = pkg.root_config.trees["porttree"].dbapi
                portdir_repo_name = portdb.getRepositoryName(portdb.porttree_root)
index eed34e99b5645aa861b73d81d7e4ee5b21b6bac2..ef298ca48cbd5dac8a3d9e23a0051c959176cb9c 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from _emerge.CompositeTask import CompositeTask
@@ -11,6 +11,9 @@ class PackageMerge(CompositeTask):
                self.scheduler = self.merge.scheduler
                pkg = self.merge.pkg
                pkg_count = self.merge.pkg_count
+               pkg_color = "PKG_MERGE"
+               if pkg.type_name == "binary":
+                       pkg_color = "PKG_BINARY_MERGE"
 
                if pkg.installed:
                        action_desc = "Uninstalling"
@@ -26,7 +29,7 @@ class PackageMerge(CompositeTask):
                msg = "%s %s%s" % \
                        (action_desc,
                        counter_str,
-                       colorize("GOOD", pkg.cpv))
+                       colorize(pkg_color, pkg.cpv))
 
                if pkg.root_config.settings["ROOT"] != "/":
                        msg += " %s %s" % (preposition, pkg.root)