diff options
author | Sebastian Luther <SebastianLuther@gmx.de> | 2010-07-11 09:26:33 +0200 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-07-11 01:17:26 -0700 |
commit | eca826bd3aa70697955ebcd035cf939efd7ab8db (patch) | |
tree | 2bd53d90c5dc367e9be289aa9cc1d62266979136 | |
parent | 2428b8cbc8f90415532a7777f70bbefeb3c1b8cc (diff) | |
download | portage-eca826bd3aa70697955ebcd035cf939efd7ab8db.tar.gz portage-eca826bd3aa70697955ebcd035cf939efd7ab8db.tar.bz2 portage-eca826bd3aa70697955ebcd035cf939efd7ab8db.zip |
emerge --info: show package names for providing packages
-rw-r--r-- | pym/_emerge/actions.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index 2e4994a22..35923929a 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -1272,14 +1272,23 @@ def action_info(settings, trees, myopts, myfiles): for cpv in pkg_matches: ver = portage.versions.cpv_getversion(cpv) repo = vardb.aux_get(cpv, ["repository"])[0] - if not repo: - repo = "<unknown repository>" - if repo != main_repo: - versions.append(ver + "::" + repo) + if repo == main_repo: + repo_suffix = "" + elif not repo: + repo_suffix = "::<unknown repository>" else: - versions.append(ver) + repo_suffix = "::" + repo + + matched_cp = portage.versions.cpv_getkey(cpv) + if matched_cp == x: + provide_suffix = "" + else: + provide_suffix = " (%s)" % matched_cp + + versions.append(ver + repo_suffix + provide_suffix) - versions.sort(cmp=lambda a,b: portage.versions.vercmp(a.split("::")[0], b.split("::")[0])) + versions.sort(cmp=lambda a,b: portage.versions.vercmp( \ + a.split()[0].split("::")[0], b.split()[0].split("::")[0])) if versions: versions = ", ".join(versions) |