From: Sebastian Luther Date: Sun, 11 Jul 2010 07:26:33 +0000 (+0200) Subject: emerge --info: show package names for providing packages X-Git-Tag: v2.2_rc68~528 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=eca826bd3aa70697955ebcd035cf939efd7ab8db;p=portage.git emerge --info: show package names for providing packages --- 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 = "" - if repo != main_repo: - versions.append(ver + "::" + repo) + if repo == main_repo: + repo_suffix = "" + elif not repo: + repo_suffix = "::" 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)