summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-08-22 22:08:34 +0000
committerZac Medico <zmedico@gentoo.org>2008-08-22 22:08:34 +0000
commitb60202e06558ecdb1fa89b25b8d68a30432357fd (patch)
tree6098dcb73070e7d46c6abc29f01697fbb621430f
parent8b6cd1d7f8d49c108a859b65959bd86aebb5b77c (diff)
downloadportage-b60202e06558ecdb1fa89b25b8d68a30432357fd.tar.gz
portage-b60202e06558ecdb1fa89b25b8d68a30432357fd.tar.bz2
portage-b60202e06558ecdb1fa89b25b8d68a30432357fd.zip
For consistency, show [0] in the repo display instead of suppressing it. Now
the repo display and [0] will only be suppressed when [0] is all that would show for every package. Thanks to Joe Peterson <lavajoe@g.o> for the suggestion. svn path=/main/trunk/; revision=11449
-rw-r--r--pym/_emerge/__init__.py54
1 files changed, 38 insertions, 16 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 59f407ddf..c6d8c71fd 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -6755,7 +6755,6 @@ class depgraph(object):
return ret
repo_display = RepoDisplay(self.roots)
- show_repos = False
tree_nodes = []
display_list = []
@@ -6906,6 +6905,10 @@ class depgraph(object):
# in size display (verbose mode)
myfetchlist=[]
+ # Use this set to detect when all the "repoadd" strings are "[0]"
+ # and disable the entire repo display in this case.
+ repoadd_set = set()
+
for mylist_index in xrange(len(mylist)):
x, depth, ordered = mylist[mylist_index]
pkg_type = x[0]
@@ -7049,7 +7052,8 @@ class depgraph(object):
counters.new += 1
verboseadd = ""
-
+ repoadd = None
+
if True:
# USE flag display
forced_flags = set()
@@ -7169,7 +7173,7 @@ class depgraph(object):
myfetchlist.append(myfetchfile)
if ordered:
counters.totalsize += mysize
- verboseadd+=format_size(mysize)+" "
+ verboseadd += format_size(mysize)
# overlay verbose
# assign index for a previous version in the same slot
@@ -7184,7 +7188,6 @@ class depgraph(object):
["repository"])[0]
# now use the data to generate output
- repoadd = None
if pkg.installed or not has_previous:
repoadd = repo_display.repoStr(repo_path_real)
else:
@@ -7198,9 +7201,8 @@ class depgraph(object):
repoadd = "%s=>%s" % (
repo_display.repoStr(repo_path_prev),
repo_display.repoStr(repo_path_real))
- if repoadd and repoadd != "0":
- show_repos = True
- verboseadd += teal("[%s]" % repoadd)
+ if repoadd:
+ repoadd_set.add(repoadd)
xs = [portage.cpv_getkey(pkg_key)] + \
list(portage.catpkgsplit(pkg_key)[2:])
@@ -7281,6 +7283,7 @@ class depgraph(object):
myprint=myprint+darkblue(" "+xs[1]+xs[2])+" "
myprint=myprint+myoldbest
myprint=myprint+darkgreen("to "+x[1])
+ verboseadd = None
else:
if not pkg_merge:
myprint = "[%s] %s%s" % \
@@ -7296,21 +7299,21 @@ class depgraph(object):
if (oldlp-nc_len(myprint)) > 0:
myprint=myprint+" "*(oldlp-nc_len(myprint))
myprint=myprint+myoldbest
- myprint=myprint+darkgreen("to "+x[1])+" "+verboseadd
+ myprint += darkgreen("to " + pkg.root)
else:
if not pkg_merge:
myprint = "[%s] " % pkgprint(pkg_status.ljust(13))
else:
myprint = "[" + pkg_type + " " + addl + "] "
myprint += indent + pkgprint(pkg_key) + " " + \
- myoldbest + darkgreen("to " + myroot) + " " + \
- verboseadd
+ myoldbest + darkgreen("to " + myroot)
else:
if "--columns" in self.myopts:
if "--quiet" in self.myopts:
myprint=addl+" "+indent+pkgprint(pkg_cp)
myprint=myprint+" "+green(xs[1]+xs[2])+" "
myprint=myprint+myoldbest
+ verboseadd = None
else:
if not pkg_merge:
myprint = "[%s] %s%s" % \
@@ -7325,16 +7328,19 @@ class depgraph(object):
myprint=myprint+green(" ["+xs[1]+xs[2]+"] ")
if (oldlp-nc_len(myprint)) > 0:
myprint=myprint+(" "*(oldlp-nc_len(myprint)))
- myprint=myprint+myoldbest+" "+verboseadd
+ myprint += myoldbest
else:
if not pkg_merge:
- myprint = "[%s] %s%s %s %s" % \
+ myprint = "[%s] %s%s %s" % \
(pkgprint(pkg_status.ljust(13)),
indent, pkgprint(pkg.cpv),
- myoldbest, verboseadd)
+ myoldbest)
else:
- myprint="["+pkgprint(pkg_type)+" "+addl+"] "+indent+pkgprint(pkg_key)+" "+myoldbest+" "+verboseadd
- p.append(myprint)
+ myprint = "[%s %s] %s%s %s" % \
+ (pkgprint(pkg_type), addl, indent,
+ pkgprint(pkg.cpv), myoldbest)
+
+ p.append((myprint, verboseadd, repoadd))
if "--tree" not in self.myopts and \
"--quiet" not in self.myopts and \
@@ -7354,8 +7360,24 @@ class depgraph(object):
p.append(colorize("WARN", "*** Portage will stop merging at this point and reload itself,"))
p.append(colorize("WARN", " then resume the merge."))
+ out = sys.stdout
+ show_repos = repoadd_set != set(["0"])
+
for x in p:
- print x
+ if isinstance(x, basestring):
+ out.write("%s\n" % (x,))
+ continue
+
+ myprint, verboseadd, repoadd = x
+
+ if verboseadd:
+ myprint += " " + verboseadd
+
+ if show_repos:
+ myprint += " " + teal("[%s]" % repoadd)
+
+ out.write("%s\n" % (myprint,))
+
for x in blockers:
print x