summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-06-25 10:36:59 +0000
committerZac Medico <zmedico@gentoo.org>2007-06-25 10:36:59 +0000
commitaa52ccdf6ac76d6f440f565371c0b675478d7271 (patch)
treef7fd7f6e4b256f7ab9fefa4b3ed0213445802261
parenta09c41972f78d904e75a6d2c607bf15ba042b405 (diff)
downloadportage-aa52ccdf6ac76d6f440f565371c0b675478d7271.tar.gz
portage-aa52ccdf6ac76d6f440f565371c0b675478d7271.tar.bz2
portage-aa52ccdf6ac76d6f440f565371c0b675478d7271.zip
For bug #142473, add 4 color classes corresponding to combinations of world/merge/nomerge attributes of each package.
svn path=/main/trunk/; revision=7031
-rw-r--r--pym/emerge/__init__.py42
-rw-r--r--pym/portage/output.py4
2 files changed, 30 insertions, 16 deletions
diff --git a/pym/emerge/__init__.py b/pym/emerge/__init__.py
index 845c5508e..3be9614b5 100644
--- a/pym/emerge/__init__.py
+++ b/pym/emerge/__init__.py
@@ -2515,6 +2515,7 @@ class depgraph(object):
else:
mydbapi = self.trees[myroot][self.pkg_tree_map[pkg_type]].dbapi
pkg_status = x[3]
+ pkg_merge = ordered and pkg_status != "nomerge"
binary_package = True
if "ebuild" == pkg_type:
if "merge" == x[3] or \
@@ -2688,7 +2689,7 @@ class depgraph(object):
if verbosity == 3:
# size verbose
mysize=0
- if x[0] == "ebuild" and ordered and x[-1] != "nomerge":
+ if pkg_type == "ebuild" and pkg_merge:
try:
myfilesdict = portdb.getfetchsizes(pkg_key,
useflags=self.useFlags[myroot][pkg_key],
@@ -2748,23 +2749,32 @@ class depgraph(object):
myoldbest=myoldbest[:-3]
myoldbest=blue("["+myoldbest+"]")
- if xs[0] in worldlist:
- pkgprint = bold
- else:
- def pkgprint(pkg):
- return pkg
+ pkg_cp = xs[0]
+ pkg_world = pkg_cp in worldlist
+
+ def pkgprint(pkg):
+ if pkg_merge:
+ if pkg_world:
+ return colorize("PKG_MERGE_WORLD", pkg)
+ else:
+ return colorize("PKG_MERGE", pkg)
+ else:
+ if pkg_world:
+ return colorize("PKG_NOMERGE_WORLD", pkg)
+ else:
+ return colorize("PKG_NOMERGE", pkg)
if x[1]!="/":
if myoldbest:
myoldbest +=" "
if "--columns" in self.myopts:
if "--quiet" in self.myopts:
- myprint=addl+" "+indent+darkgreen(pkgprint(xs[0]))
+ myprint=addl+" "+indent+pkgprint(pkg_cp)
myprint=myprint+darkblue(" "+xs[1]+xs[2])+" "
myprint=myprint+myoldbest
myprint=myprint+darkgreen("to "+x[1])
else:
- myprint="["+x[0]+" "+addl+"] "+indent+darkgreen(pkgprint(xs[0]))
+ myprint="["+pkgprint(pkg_type)+" "+addl+"] "+indent+pkgprint(pkg_cp)
if (newlp-nc_len(myprint)) > 0:
myprint=myprint+(" "*(newlp-nc_len(myprint)))
myprint=myprint+"["+darkblue(xs[1]+xs[2])+"] "
@@ -2773,21 +2783,21 @@ class depgraph(object):
myprint=myprint+myoldbest
myprint=myprint+darkgreen("to "+x[1])+" "+verboseadd
else:
- if x[-1] == "nomerge" or not ordered:
- myprint = darkblue("[nomerge ] ")
+ if not pkg_merge:
+ myprint = "[%s ] " % pkgprint("nomerge")
else:
myprint = "[" + pkg_type + " " + addl + "] "
- myprint += indent + darkgreen(pkgprint(pkg_key)) + " " + \
+ myprint += indent + pkgprint(pkg_key) + " " + \
myoldbest + darkgreen("to " + myroot) + " " + \
verboseadd
else:
if "--columns" in self.myopts:
if "--quiet" in self.myopts:
- myprint=addl+" "+indent+darkgreen(pkgprint(xs[0]))
+ myprint=addl+" "+indent+pkgprint(pkg_cp)
myprint=myprint+" "+green(xs[1]+xs[2])+" "
myprint=myprint+myoldbest
else:
- myprint="["+x[0]+" "+addl+"] "+indent+darkgreen(pkgprint(xs[0]))
+ myprint="["+pkgprint(pkg_type)+" "+addl+"] "+indent+pkgprint(pkg_cp)
if (newlp-nc_len(myprint)) > 0:
myprint=myprint+(" "*(newlp-nc_len(myprint)))
myprint=myprint+green(" ["+xs[1]+xs[2]+"] ")
@@ -2795,10 +2805,10 @@ class depgraph(object):
myprint=myprint+(" "*(oldlp-nc_len(myprint)))
myprint=myprint+myoldbest+" "+verboseadd
else:
- if x[-1] == "nomerge" or not ordered:
- myprint=darkblue("[nomerge ] "+indent+pkgprint(x[2])+" "+myoldbest+" ")+verboseadd
+ if not pkg_merge:
+ myprint="["+pkgprint("nomerge")+" ] "+indent+pkgprint(pkg_key)+" "+myoldbest+" "+verboseadd
else:
- myprint="["+x[0]+" "+addl+"] "+indent+darkgreen(pkgprint(x[2]))+" "+myoldbest+" "+verboseadd
+ myprint="["+pkgprint(pkg_type)+" "+addl+"] "+indent+pkgprint(pkg_key)+" "+myoldbest+" "+verboseadd
p.append(myprint)
mysplit = portage.pkgsplit(x[2])
diff --git a/pym/portage/output.py b/pym/portage/output.py
index 010c0472f..7c0505b21 100644
--- a/pym/portage/output.py
+++ b/pym/portage/output.py
@@ -129,6 +129,10 @@ codes["INFORM"] = codes["darkgreen"]
codes["UNMERGE_WARN"] = codes["red"]
codes["SECURITY_WARN"] = codes["red"]
codes["MERGE_LIST_PROGRESS"] = codes["yellow"]
+codes["PKG_MERGE"] = codes["darkgreen"]
+codes["PKG_MERGE_WORLD"] = codes["green"]
+codes["PKG_NOMERGE"] = codes["darkblue"]
+codes["PKG_NOMERGE_WORLD"] = codes["blue"]
def parse_color_map():
myfile = COLOR_MAP_FILE