From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 2767B198005 for ; Sun, 17 Mar 2013 22:38:37 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AB8E6E04F2; Sun, 17 Mar 2013 22:38:36 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 24F14E04F2 for ; Sun, 17 Mar 2013 22:38:36 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1366333BF45 for ; Sun, 17 Mar 2013 22:38:35 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id A4C65E4073 for ; Sun, 17 Mar 2013 22:38:33 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1363559899.5251fd64876bfbbfe5e98ac9340c7fadf6aa66c7.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/portageq X-VCS-Directories: bin/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 5251fd64876bfbbfe5e98ac9340c7fadf6aa66c7 X-VCS-Branch: master Date: Sun, 17 Mar 2013 22:38:33 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: bcab6773-b427-4d12-b434-d2b5a2b6a6fb X-Archives-Hash: 33e036791c74eef156ff294590c9b651 commit: 5251fd64876bfbbfe5e98ac9340c7fadf6aa66c7 Author: Zac Medico gentoo org> AuthorDate: Sun Mar 17 22:36:54 2013 +0000 Commit: Zac Medico gentoo org> CommitDate: Sun Mar 17 22:38:19 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5251fd64 portageq: emulate subset of Pkgcore's pquery Pkgcore pquery compatible options: Repository matching options: --repo=REPO repo to use (default is PORTDIR if omitted) --all-repos search all repos Package matching options: --herd=HERD exact match on a herd --maintainer-email=MAINTAINER_EMAIL comma-separated list of maintainer email regexes to search for Output formatting: -n, --no-version collapse multiple matching versions together --- bin/portageq | 156 +++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 145 insertions(+), 11 deletions(-) diff --git a/bin/portageq b/bin/portageq index 48e7651..01edd15 100755 --- a/bin/portageq +++ b/bin/portageq @@ -20,6 +20,7 @@ try: except KeyboardInterrupt: sys.exit(128 + signal.SIGINT) +import optparse import os import types @@ -41,11 +42,13 @@ from portage import os from portage.eapi import eapi_has_repo_deps from portage.util import writemsg, writemsg_stdout portage.proxy.lazyimport.lazyimport(globals(), + 're', 'subprocess', '_emerge.Package:Package', '_emerge.RootConfig:RootConfig', 'portage.dbapi._expand_new_virt:expand_new_virt', 'portage._sets.base:InternalPackageSet', + 'portage.xml.metadata:MetaDataXML' ) def eval_atom_use(atom): @@ -874,11 +877,11 @@ list_preserved_libs.uses_eroot = True # DO NOT CHANGE CODE BEYOND THIS POINT - IT'S NOT NEEDED! # -non_commands = frozenset(['elog', 'eval_atom_use', 'exithandler', 'main', 'usage']) +non_commands = frozenset(['elog', 'eval_atom_use', 'exithandler', 'main', 'pquery', 'usage']) commands = sorted(k for k, v in globals().items() \ if k not in non_commands and isinstance(v, types.FunctionType) and v.__module__ == "__main__") -def usage(argv): +def usage(argv, parser=None, pquery_option_groups=None): print(">>> Portage information query tool") print(">>> %s" % portage.VERSION) print(">>> Usage: portageq [