From f2776a791a89fc4d0668f7dd93fc97185d5ae215 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 28 Mar 2008 12:36:04 +0000 Subject: [PATCH] display versions of other slots for new-slot installs (bug #213790) (trunk r9488) svn path=/main/branches/2.1.2/; revision=9566 --- bin/emerge | 46 +++++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/bin/emerge b/bin/emerge index 1b28dc760..95ab24baf 100755 --- a/bin/emerge +++ b/bin/emerge @@ -3395,7 +3395,8 @@ class depgraph: #we need to use "--emptrytree" testing here rather than "empty" param testing because "empty" #param is used for -u, where you still *do* want to see when something is being upgraded. - myoldbest="" + myoldbest = "" + myinslotlist = None installed_versions = vardb.match(portage.cpv_getkey(pkg_key)) if vardb.cpv_exists(pkg_key): addl=" "+yellow("R")+fetch+" " @@ -3417,21 +3418,22 @@ class depgraph: portage.cpv_getkey(pkg_key): myinslotlist = None if myinslotlist: - myoldbest=portage.best(myinslotlist) - addl=" "+fetch + myoldbest = portage.best(myinslotlist) + addl = " " + fetch if portage.pkgcmp(portage.pkgsplit(x[2]), portage.pkgsplit(myoldbest)) < 0: # Downgrade in slot - addl+=turquoise("U")+blue("D") + addl += turquoise("U")+blue("D") if ordered: counters.downgrades += 1 else: # Update in slot - addl+=turquoise("U")+" " + addl += turquoise("U") + " " if ordered: counters.upgrades += 1 else: # New slot, mark it new. - addl=" "+green("NS")+fetch+" " + addl = " " + green("NS") + fetch + " " + myoldbest = vardb.match(portage.cpv_getkey(pkg_key)) if ordered: counters.newslot += 1 @@ -3444,11 +3446,11 @@ class depgraph: portdb.findname(pkg_key), inst_matches[0], pkg_key)) else: - addl=" "+green("N")+" "+fetch+" " + addl = " " + green("N") + " " + fetch + " " if ordered: counters.new += 1 - verboseadd="" + verboseadd = "" if True: # USE flag display @@ -3465,7 +3467,7 @@ class depgraph: cur_use = pkg_use cur_use = [flag for flag in cur_use if flag in cur_iuse] - if myoldbest: + if myoldbest and myinslotlist: pkg = myoldbest else: pkg = x[2] @@ -3612,11 +3614,11 @@ class depgraph: show_repos = True verboseadd += teal("[%s]" % repoadd) - xs=portage.pkgsplit(x[2]) - if xs[2]=="r0": - xs[2]="" + xs = list(portage.pkgsplit(x[2])) + if xs[2] == "r0": + xs[2] = "" else: - xs[2]="-"+xs[2] + xs[2] = "-" + xs[2] mywidth = 130 if "COLUMNWIDTH" in self.settings: @@ -3628,16 +3630,22 @@ class depgraph: "!!! Unable to parse COLUMNWIDTH='%s'\n" % \ self.settings["COLUMNWIDTH"], noiselevel=-1) del e - oldlp=mywidth-30 - newlp=oldlp-30 + oldlp = mywidth - 30 + newlp = oldlp - 30 indent = " " * depth if myoldbest: - myoldbest=portage.pkgsplit(myoldbest)[1]+"-"+portage.pkgsplit(myoldbest)[2] - if myoldbest[-3:]=="-r0": - myoldbest=myoldbest[:-3] - myoldbest=blue("["+myoldbest+"]") + if myinslotlist: + myoldbest = [myoldbest] + for key in myoldbest: + pos = myoldbest.index(key) + key = portage.pkgsplit(key)[1] + "-" + portage.pkgsplit(key)[2] + if key[-3:] == "-r0": + key = key[:-3] + myoldbest[pos] = key + myoldbest = blue("["+", ".join(myoldbest)+"]") + pkg_cp = xs[0] root_config = self.roots[myroot] -- 2.26.2