Display satisfied blockers in green and show a small "b" instead of a
authorZac Medico <zmedico@gentoo.org>
Tue, 6 May 2008 00:16:31 +0000 (00:16 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 6 May 2008 00:16:31 +0000 (00:16 -0000)
big "B" (similar to "f" for satisfied fetch restrictions).
(trunk r10214)

svn path=/main/branches/2.1.2/; revision=10215

bin/emerge
man/color.map.5
pym/output.py

index 4cc690f38af3ce88002a918e4dd8d372f3887037..e7d0d29f9ced7f436b5bc36b25a79c4e92945198 100755 (executable)
@@ -4383,24 +4383,35 @@ class depgraph(object):
                        fetch=" "
                        indent = " " * depth
 
-                       if x[0]=="blocks":
-                               addl=""+red("B")+"  "+fetch+"  "
+                       if isinstance(x, Blocker):
+                               if x.satisfied:
+                                       blocker_style = "PKG_BLOCKER_SATISFIED"
+                                       addl = "%s  %s  " % (colorize(blocker_style, "b"), fetch)
+                               else:
+                                       blocker_style = "PKG_BLOCKER"
+                                       addl = "%s  %s  " % (colorize(blocker_style, "B"), fetch)
                                if ordered:
                                        counters.blocks += 1
+                                       if x.satisfied:
+                                               counters.blocks_satisfied += 1
                                resolved = portage.key_expand(
                                        pkg_key, mydb=vardb, settings=pkgsettings)
                                if "--columns" in self.myopts and "--quiet" in self.myopts:
-                                       addl = addl + " " + red(resolved)
+                                       addl += " " + colorize(blocker_style, resolved)
                                else:
-                                       addl = "[blocks " + addl + "] " + indent + red(resolved)
+                                       addl = "[%s %s] %s%s" % \
+                                               (colorize(blocker_style, "blocks"),
+                                               addl, indent, colorize(blocker_style, resolved))
                                block_parents = self._blocker_parents.parent_nodes(x)
                                block_parents = set([pnode[2] for pnode in block_parents])
                                block_parents = ", ".join(block_parents)
                                if resolved!=x[2]:
-                                       addl += bad(" (\"%s\" is blocking %s)") % \
+                                       addl += colorize(blocker_style,
+                                               " (\"%s\" is blocking %s)") % \
                                                (pkg_key, block_parents)
                                else:
-                                       addl += bad(" (is blocking %s)") % block_parents
+                                       addl += colorize(blocker_style,
+                                               " (is blocking %s)") % block_parents
                                if isinstance(x, Blocker) and x.satisfied:
                                        p.append(addl)
                                else:
@@ -5449,6 +5460,7 @@ class PackageCounters(object):
                self.reinst     = 0
                self.uninst     = 0
                self.blocks     = 0
+               self.blocks_satisfied         = 0
                self.totalsize  = 0
                self.restrict_fetch           = 0
                self.restrict_fetch_satisfied = 0
@@ -5484,10 +5496,6 @@ class PackageCounters(object):
                        details.append("%s uninstall" % self.uninst)
                        if self.uninst > 1:
                                details[-1] += "s"
-               if self.blocks > 0:
-                       details.append("%s block" % self.blocks)
-                       if self.blocks > 1:
-                               details[-1] += "s"
                myoutput.append(", ".join(details))
                if total_installs != 0:
                        myoutput.append(")")
@@ -5500,6 +5508,14 @@ class PackageCounters(object):
                if self.restrict_fetch_satisfied < self.restrict_fetch:
                        myoutput.append(bad(" (%s unsatisfied)") % \
                                (self.restrict_fetch - self.restrict_fetch_satisfied))
+               if self.blocks > 0:
+                       myoutput.append("\nConflict: %s blocker" % \
+                               self.blocks)
+                       if self.blocks > 1:
+                               myoutput.append("s")
+                       if self.blocks_satisfied < self.blocks:
+                               myoutput.append(bad(" (%s unsatisfied)") % \
+                                       (self.blocks - self.blocks_satisfied))
                return "".join(myoutput)
 
 class MergeTask(object):
index 68f96d0ca62ea4ffbf32965733f1725e11121007..82cc51eb5cb510f639e3233f3e1ddee46f03edb5 100644 (file)
@@ -30,6 +30,12 @@ Defines color used for informational words.
 \fBMERGE_LIST_PROGRESS\fR = \fI"yellow"\fR
 Defines color used for numbers indicating merge progress.
 .TP
+\fBPKG_BLOCKER\fR = \fI"red"\fR
+Defines color used for unsatisfied blockers.
+.TP
+\fBPKG_BLOCKER_SATSIFIED\fR = \fI"green"\fR
+Defines color used for satisfied blockers.
+.TP
 \fBPKG_MERGE\fR = \fI"darkgreen"\fR
 Defines color used for packages planned to be merged.
 .TP
index ce43f84fb620835d01b5ff96ed70a8a559a6c37b..d9fc84690028ec348c8002a530b056f6bf0115e2 100644 (file)
@@ -142,6 +142,8 @@ codes["INFORM"]                  = codes["darkgreen"]
 codes["UNMERGE_WARN"]            = codes["red"]
 codes["SECURITY_WARN"]           = codes["red"]
 codes["MERGE_LIST_PROGRESS"]     = codes["yellow"]
+codes["PKG_BLOCKER"]             = codes["red"]
+codes["PKG_BLOCKER_SATISFIED"]   = codes["green"]
 codes["PKG_MERGE"]               = codes["darkgreen"]
 codes["PKG_MERGE_SYSTEM"]        = codes["darkgreen"]
 codes["PKG_MERGE_WORLD"]         = codes["green"]