From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QFpFg-0002Go-61 for garchives@archives.gentoo.org; Fri, 29 Apr 2011 15:05:04 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 477DB1C01B; Fri, 29 Apr 2011 15:04:56 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 092541C01B for ; Fri, 29 Apr 2011 15:04:55 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8F6B31B4088 for ; Fri, 29 Apr 2011 15:04:55 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id E99FB80504 for ; Fri, 29 Apr 2011 15:04:54 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: Subject: [gentoo-commits] proj/portage:master commit in: pym/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: pym/_emerge/actions.py X-VCS-Directories: pym/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: b67367d3e7d11a0d7d62e48d433c76eae64e5f99 Date: Fri, 29 Apr 2011 15:04:54 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 816c5e8f900f4069d29835281e732981 commit: b67367d3e7d11a0d7d62e48d433c76eae64e5f99 Author: Zac Medico gentoo org> AuthorDate: Fri Apr 29 15:04:13 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Fri Apr 29 15:04:13 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3Db67367d3 action_info: eliminate duplicate info_pkgs match Currently, sys-kernel/linux-headers is matched by both a plain sys-kernel/linux-headers atom and by the virtual/os-headers new-style virtual. For backward compatibility, we're going to have duplicates like this for at least a few months (see bug #364673, comment #5). Therefore, automatically eliminate duplicates in the display. Entries that include virtual provider info are preferred over those that do not. --- pym/_emerge/actions.py | 31 +++++++++++++++++++++---------- 1 files changed, 21 insertions(+), 10 deletions(-) diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index 59db58d..6379b36 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -1427,13 +1427,26 @@ def action_info(settings, trees, myopts, myfiles)= : =20 portdb =3D trees["/"]["porttree"].dbapi main_repo =3D portdb.getRepositoryName(portdb.porttree_root) + cp_map =3D {} + cp_max_len =3D 0 =20 for orig_atom, x in myvars: pkg_matches =3D vardb.match(x) =20 versions =3D [] for cpv in pkg_matches: + matched_cp =3D portage.versions.cpv_getkey(cpv) ver =3D portage.versions.cpv_getversion(cpv) + ver_map =3D cp_map.setdefault(matched_cp, {}) + prev_match =3D ver_map.get(ver) + if prev_match is not None: + if prev_match.provide_suffix: + # prefer duplicate matches that include + # additional virtual provider info + continue + + if len(matched_cp) > cp_max_len: + cp_max_len =3D len(matched_cp) repo =3D vardb.aux_get(cpv, ["repository"])[0] if repo =3D=3D main_repo: repo_suffix =3D "" @@ -1441,22 +1454,20 @@ def action_info(settings, trees, myopts, myfiles)= : repo_suffix =3D "::" else: repo_suffix =3D "::" + repo - =09 - matched_cp =3D portage.versions.cpv_getkey(cpv) + if matched_cp =3D=3D orig_atom.cp: provide_suffix =3D "" else: provide_suffix =3D " (%s)" % (orig_atom,) =20 - versions.append( - _info_pkgs_ver(ver, repo_suffix, provide_suffix)) - - versions.sort() + ver_map[ver] =3D _info_pkgs_ver(ver, repo_suffix, provide_suffix) =20 - if versions: - versions =3D ", ".join(ver.toString() for ver in versions) - writemsg_stdout("%-20s %s\n" % (x+":", versions), - noiselevel=3D-1) + for cp in sorted(cp_map): + versions =3D sorted(cp_map[cp].values()) + versions =3D ", ".join(ver.toString() for ver in versions) + writemsg_stdout("%s %s\n" % \ + ((cp + ":").ljust(cp_max_len + 1), versions), + noiselevel=3D-1) =20 libtool_vers =3D ",".join(trees["/"]["vartree"].dbapi.match("sys-devel/= libtool")) =20