highlight world packages in --pretend output (bug #142473, trunk r6979)
authorZac Medico <zmedico@gentoo.org>
Sun, 24 Jun 2007 22:10:08 +0000 (22:10 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 24 Jun 2007 22:10:08 +0000 (22:10 -0000)
svn path=/main/branches/2.1.2/; revision=7009

bin/emerge

index 43c7efc27c01c396c9081ca86b73f4a73560b626..67bf8db2a101b8c0f77913b181c3c72f87aeab66 100755 (executable)
@@ -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: