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 1QskS2-0007nt-3l for garchives@archives.gentoo.org; Sun, 14 Aug 2011 23:50:42 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3BDDA21C116; Sun, 14 Aug 2011 23:50:34 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id E6B7321C116 for ; Sun, 14 Aug 2011 23:50:33 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 07A0A1B405D for ; Sun, 14 Aug 2011 23:50:33 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 32E2A80040 for ; Sun, 14 Aug 2011 23:50:32 +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: <0c8d952b89afe44ff561b278188d5a22d91e9529.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: pym/_emerge/search.py X-VCS-Directories: pym/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 0c8d952b89afe44ff561b278188d5a22d91e9529 Date: Sun, 14 Aug 2011 23:50:32 +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: 298d4b94d6e6f00346ffdb3e2cfb0f56 commit: 0c8d952b89afe44ff561b278188d5a22d91e9529 Author: Zac Medico gentoo org> AuthorDate: Sun Aug 14 23:49:57 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Sun Aug 14 23:49:57 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D0c8d952b emerge --search: account for USE in fetch size --- pym/_emerge/search.py | 26 +++++++++++++++++++------- 1 files changed, 19 insertions(+), 7 deletions(-) diff --git a/pym/_emerge/search.py b/pym/_emerge/search.py index 35f0412..096b384 100644 --- a/pym/_emerge/search.py +++ b/pym/_emerge/search.py @@ -1,4 +1,4 @@ -# Copyright 1999-2009 Gentoo Foundation +# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 =20 from __future__ import print_function @@ -6,6 +6,8 @@ from __future__ import print_function import re import portage from portage import os +from portage.dbapi.porttree import _parse_uri_map +from portage.manifest import Manifest from portage.output import bold, bold as white, darkgreen, green, red from portage.util import writemsg_stdout =20 @@ -261,11 +263,13 @@ class search(object): msg.append("[ Applications found : " + \ bold(str(self.mlen)) + " ]\n\n") vardb =3D self.vartree.dbapi + metadata_keys =3D set(Package.metadata_keys) + metadata_keys.update(["DESCRIPTION", "HOMEPAGE", "LICENSE", "SRC_URI"]= ) + metadata_keys =3D tuple(metadata_keys) for mtype in self.matches: for match,masked in self.matches[mtype]: full_package =3D None if mtype =3D=3D "pkg": - catpack =3D match full_package =3D self._xmatch( "bestmatch-visible", match) if not full_package: @@ -285,11 +289,16 @@ class search(object): + "\n\n") if full_package: try: - desc, homepage, license =3D self._aux_get( - full_package, ["DESCRIPTION","HOMEPAGE","LICENSE"]) + metadata =3D dict(zip(metadata_keys, + self._aux_get(full_package, metadata_keys))) except KeyError: msg.append("emerge: search: aux_get() failed, skipping\n") continue + + desc =3D metadata["DESCRIPTION"] + homepage =3D metadata["HOMEPAGE"] + license =3D metadata["LICENSE"] + if masked: msg.append(green("*") + " " + \ white(match) + " " + red("[ Masked ]") + "\n") @@ -304,12 +313,15 @@ class search(object): mycpv =3D match + "-" + myversion myebuild =3D self._findname(mycpv) if myebuild: + pkg =3D Package(built=3DFalse, cpv=3Dmycpv, + installed=3DFalse, metadata=3Dmetadata, + root_config=3Dself.root_config, type_name=3D"ebuild") pkgdir =3D os.path.dirname(myebuild) - from portage import manifest - mf =3D manifest.Manifest( + mf =3D Manifest( pkgdir, self.settings["DISTDIR"]) try: - uri_map =3D self._getFetchMap(mycpv) + uri_map =3D _parse_uri_map(mycpv, metadata, + use=3Dpkg.use.enabled) except portage.exception.InvalidDependString as e: file_size_str =3D "Unknown (%s)" % (e,) del e