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 1REMtE-0007Y4-L9 for garchives@archives.gentoo.org; Thu, 13 Oct 2011 15:08:09 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 88EB521C155; Thu, 13 Oct 2011 15:07:56 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 5CB6221C155 for ; Thu, 13 Oct 2011 15:07:56 +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 962371B4004 for ; Thu, 13 Oct 2011 15:07:55 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id B9E2380042 for ; Thu, 13 Oct 2011 15:07: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: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/quickpkg X-VCS-Directories: bin/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: a580aee32bec544889e08a76b4d0f308447f8d89 Date: Thu, 13 Oct 2011 15:07: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: ca8e7c0e1f002e0094df69ac65298557 commit: a580aee32bec544889e08a76b4d0f308447f8d89 Author: Sebastian Luther gmx de> AuthorDate: Thu Oct 13 13:03:34 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Thu Oct 13 15:07:39 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3Da580aee3 quickpkg: Support extended atoms --- bin/quickpkg | 40 +++++++++++++++++++++++++++++++++++++++- 1 files changed, 39 insertions(+), 1 deletions(-) diff --git a/bin/quickpkg b/bin/quickpkg index 09723f5..c95a584 100755 --- a/bin/quickpkg +++ b/bin/quickpkg @@ -21,7 +21,7 @@ except ImportError: from portage import os from portage import xpak from portage.dbapi.dep_expand import dep_expand -from portage.dep import use_reduce +from portage.dep import Atom, extended_cp_match, use_reduce from portage.exception import InvalidAtom, InvalidData, InvalidDependStr= ing, \ PackageSetNotFound, PermissionDenied from portage.util import ConfigProtect, ensure_dirs, shlex_split @@ -187,6 +187,42 @@ def quickpkg_set(options, infos, arg, eout): for atom in atoms: quickpkg_atom(options, infos, atom, eout) =20 + +def quickpkg_extended_atom(options, infos, arg, eout): + root =3D portage.settings["ROOT"] + trees =3D portage.db[root] + vartree =3D trees["vartree"] + vardb =3D vartree.dbapi + + try: + atom =3D Atom(arg, allow_wildcard=3DTrue, allow_repo=3DTrue) + except (InvalidAtom, InvalidData): + eout.eerror("Invalid atom: %s" % (arg,)) + infos["missing"].append(arg) + return + + require_metadata =3D atom.slot or atom.repo + atoms =3D [] + for cpv in vardb.cpv_all(): + cpv_atom =3D Atom("=3D%s" % cpv) + if not extended_cp_match(atom.cp, cpv_atom.cp): + continue + + if require_metadata: + slot, repo =3D vardb.aux_get(cpv, ["SLOT", "repository"]) + + if atom.slot and atom.slot !=3D slot: + continue + + if atom.repo and atom.repo !=3D repo: + continue + + atoms.append(cpv_atom) + + for atom in atoms: + quickpkg_atom(options, infos, atom, eout) + + def quickpkg_main(options, args, eout): root =3D portage.settings["ROOT"] trees =3D portage.db[root] @@ -207,6 +243,8 @@ def quickpkg_main(options, args, eout): for arg in args: if arg[0] =3D=3D SETPREFIX: quickpkg_set(options, infos, arg, eout) + elif '*' in arg: + quickpkg_extended_atom(options, infos, arg, eout) else: quickpkg_atom(options, infos, arg, eout) =20