From d7e00208d4e4957c3cc4ae443b14b9cdf27a4e0d Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 6 May 2008 00:16:31 +0000 Subject: [PATCH] Display satisfied blockers in green and show a small "b" instead of a big "B" (similar to "f" for satisfied fetch restrictions). (trunk r10214) svn path=/main/branches/2.1.2/; revision=10215 --- bin/emerge | 36 ++++++++++++++++++++++++++---------- man/color.map.5 | 6 ++++++ pym/output.py | 2 ++ 3 files changed, 34 insertions(+), 10 deletions(-) diff --git a/bin/emerge b/bin/emerge index 4cc690f38..e7d0d29f9 100755 --- a/bin/emerge +++ b/bin/emerge @@ -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): diff --git a/man/color.map.5 b/man/color.map.5 index 68f96d0ca..82cc51eb5 100644 --- a/man/color.map.5 +++ b/man/color.map.5 @@ -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 diff --git a/pym/output.py b/pym/output.py index ce43f84fb..d9fc84690 100644 --- a/pym/output.py +++ b/pym/output.py @@ -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"] -- 2.26.2