From a7dc823a0e15d87e6598c4af6d610cfc2ffef8b3 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 25 Jun 2007 10:41:36 +0000 Subject: For bug #142473, add 4 color classes corresponding to combinations of world/merge/nomerge attributes of each package. (trunk r7031) svn path=/main/branches/2.1.2/; revision=7032 --- bin/emerge | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) (limited to 'bin/emerge') diff --git a/bin/emerge b/bin/emerge index ed6e71998..9f75bc7ee 100755 --- a/bin/emerge +++ b/bin/emerge @@ -2484,6 +2484,7 @@ class depgraph: 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 \ @@ -2657,7 +2658,7 @@ class depgraph: 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], @@ -2717,23 +2718,32 @@ class depgraph: 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])+"] " @@ -2742,21 +2752,21 @@ class depgraph: 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]+"] ") @@ -2764,10 +2774,10 @@ class depgraph: 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]) -- cgit v1.2.3-1-g7c22