From 2ec7e4c89c0a6d456291358897e8f892fb6f8285 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 24 Jun 2007 22:10:08 +0000 Subject: [PATCH] highlight world packages in --pretend output (bug #142473, trunk r6979) svn path=/main/branches/2.1.2/; revision=7009 --- bin/emerge | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/bin/emerge b/bin/emerge index 43c7efc27..67bf8db2a 100755 --- a/bin/emerge +++ b/bin/emerge @@ -2446,6 +2446,8 @@ class depgraph: # files to fetch list - avoids counting a same file twice # in size display (verbose mode) myfetchlist=[] + worldlist = set(getlist(self.settings, "world")) + for mylist_index in xrange(len(mylist)): x, depth, ordered = mylist[mylist_index] pkg_type = x[0] @@ -2714,17 +2716,23 @@ class depgraph: myoldbest=myoldbest[:-3] myoldbest=blue("["+myoldbest+"]") + if xs[0] in worldlist: + pkgprint = bold + else: + def pkgprint(pkg): + return pkg + if x[1]!="/": if myoldbest: myoldbest +=" " if "--columns" in self.myopts: if "--quiet" in self.myopts: - myprint=addl+" "+indent+darkgreen(xs[0]) + myprint=addl+" "+indent+darkgreen(pkgprint(xs[0])) myprint=myprint+darkblue(" "+xs[1]+xs[2])+" " myprint=myprint+myoldbest myprint=myprint+darkgreen("to "+x[1]) else: - myprint="["+x[0]+" "+addl+"] "+indent+darkgreen(xs[0]) + myprint="["+x[0]+" "+addl+"] "+indent+darkgreen(pkgprint(xs[0])) if (newlp-nc_len(myprint)) > 0: myprint=myprint+(" "*(newlp-nc_len(myprint))) myprint=myprint+"["+darkblue(xs[1]+xs[2])+"] " @@ -2737,17 +2745,17 @@ class depgraph: myprint = darkblue("[nomerge ] ") else: myprint = "[" + pkg_type + " " + addl + "] " - myprint += indent + darkgreen(pkg_key) + " " + \ + myprint += indent + darkgreen(pkrprint(pkg_key)) + " " + \ myoldbest + darkgreen("to " + myroot) + " " + \ verboseadd else: if "--columns" in self.myopts: if "--quiet" in self.myopts: - myprint=addl+" "+indent+darkgreen(xs[0]) + myprint=addl+" "+indent+darkgreen(pkgprint(xs[0])) myprint=myprint+" "+green(xs[1]+xs[2])+" " myprint=myprint+myoldbest else: - myprint="["+x[0]+" "+addl+"] "+indent+darkgreen(xs[0]) + myprint="["+x[0]+" "+addl+"] "+indent+darkgreen(pkgprint(xs[0])) if (newlp-nc_len(myprint)) > 0: myprint=myprint+(" "*(newlp-nc_len(myprint))) myprint=myprint+green(" ["+xs[1]+xs[2]+"] ") @@ -2756,9 +2764,9 @@ class depgraph: myprint=myprint+myoldbest+" "+verboseadd else: if x[-1] == "nomerge" or not ordered: - myprint=darkblue("[nomerge ] "+indent+x[2]+" "+myoldbest+" ")+verboseadd + myprint=darkblue("[nomerge ] "+indent+pkgprint(x[2])+" "+myoldbest+" ")+verboseadd else: - myprint="["+x[0]+" "+addl+"] "+indent+darkgreen(x[2])+" "+myoldbest+" "+verboseadd + myprint="["+x[0]+" "+addl+"] "+indent+darkgreen(pkgprint(x[2]))+" "+myoldbest+" "+verboseadd p.append(myprint) mysplit = portage.pkgsplit(x[2]) @@ -5479,7 +5487,7 @@ def emerge_main(): ("--fetchonly" in myopts or \ "--fetch-all-uri" in myopts or \ myaction in ("metadata", "regen") or \ - (myaction == "sync" and os.access(settings["PORTDIR"], os.W_OK)) + (myaction == "sync" and os.access(settings["PORTDIR"], os.W_OK))) if portage.secpass < 1 or \ need_superuser: if need_superuser: -- 2.26.2