diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-05-06 00:12:51 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-05-06 00:12:51 +0000 |
commit | 7268523ce2f991a9007f6062121cca72781bb797 (patch) | |
tree | 35d36c985345776d716561d7e23938daf2fbffb0 | |
parent | 93a371d22f5c368e6a4ad2bcfca84bfd26ee0bdb (diff) | |
download | portage-7268523ce2f991a9007f6062121cca72781bb797.tar.gz portage-7268523ce2f991a9007f6062121cca72781bb797.tar.bz2 portage-7268523ce2f991a9007f6062121cca72781bb797.zip |
Display satisfied blockers in green and show a small "b" instead of a
big "B" (similar to "f" for satisfied fetch restrictions).
svn path=/main/trunk/; revision=10214
-rw-r--r-- | man/color.map.5 | 6 | ||||
-rw-r--r-- | pym/_emerge/__init__.py | 36 | ||||
-rw-r--r-- | pym/portage/output.py | 2 |
3 files changed, 34 insertions, 10 deletions
diff --git a/man/color.map.5 b/man/color.map.5 index 8d2bfeeaf..e7eeb32df 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/_emerge/__init__.py b/pym/_emerge/__init__.py index 1baaff7f8..588972f42 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -4229,24 +4229,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: @@ -5287,6 +5298,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 @@ -5322,10 +5334,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(")") @@ -5338,6 +5346,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/pym/portage/output.py b/pym/portage/output.py index 5c2c2b662..1562485bd 100644 --- a/pym/portage/output.py +++ b/pym/portage/output.py @@ -148,6 +148,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"] |