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 4039A59CA3 for ; Sun, 6 Mar 2016 12:32:05 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C003721C007 for ; Sun, 6 Mar 2016 12:32:04 +0000 (UTC) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id BD00E21C003 for ; Sat, 5 Mar 2016 07:09:11 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id CF4B0202FE for ; Sat, 5 Mar 2016 02:09:10 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute3.internal (MEProxy); Sat, 05 Mar 2016 02:09:10 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=Fn0QFrc6f+2PvobXhHvtlAcVf0I=; b=sg++h ojKc1AkIUvNxK2TWWSFWRK/Tc3VEVe2RH/s+2tOmHE+tcY0mzjKV/2Ae1vhOByOu pSE8xtjTirS9lfnqm5HYZ6g28SdlYPhvRMB6rjN0ozChG4i8BfbRuAak+0vKBSkS oCJJIeCcgfogOc/SZM65VMwb1i+K+ehT+QZZXk= X-Sasl-enc: X16TsqZwmbD4Tfz2e2U2b38qhmD4B9cgh338rW0HySqA 1457161750 Received: from localhost.localdomain (cpe-142-105-208-68.stny.res.rr.com [142.105.208.68]) by mail.messagingengine.com (Postfix) with ESMTPA id 874AF6800A7 for ; Sat, 5 Mar 2016 02:09:10 -0500 (EST) From: =?UTF-8?q?G=C3=B6kt=C3=BCrk=20Y=C3=BCksek?= To: gentoo-portage-dev@lists.gentoo.org Subject: [gentoo-portage-dev] [PATCH] bin/portageq: add a matcher to match the orphaned (maintainer-needed) packages Date: Sat, 5 Mar 2016 02:08:46 -0500 Message-Id: <1457161726-6649-1-git-send-email-gokturk@binghamton.edu> X-Mailer: git-send-email 2.4.10 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: 1f628b76-42f6-4b30-9285-62db95e2dbe2 X-Archives-Hash: 7de18caa1de6bff8fdd9b211ea925f9a Per GLEP 67, orphaned packages do not have a in metadata.xml. They can't be matched using '--maintainer-email=maintainer-needed@gentoo.org' anymore. Add a new command line argument '--orphaned' to match the orphaned packages. Signed-off-by: Göktürk Yüksek --- bin/portageq | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/bin/portageq b/bin/portageq index 925640b..8ec81ea 100755 --- a/bin/portageq +++ b/bin/portageq @@ -1028,6 +1028,12 @@ class HerdMatcher(object): herds = self._herds return any(x in herds for x in metadata_xml.herds()) +class OrphanedMatcher(object): + def __call__(self, metadata_xml): + if not metadata_xml.maintainers(): + return True + else: + return False def pquery(parser, opts, args): portdb = portage.db[portage.root]['porttree'].dbapi @@ -1090,6 +1096,8 @@ def pquery(parser, opts, args): for x in opts.herd: herds.extend(x.split(",")) xml_matchers.append(HerdMatcher(herds)) + if opts.orphaned: + xml_matchers.append(OrphanedMatcher()) if opts.repo is not None: repos = [portdb.repositories[opts.repo]] @@ -1248,6 +1256,11 @@ def add_pquery_arguments(parser): "longopt": "--maintainer-email", "action": "append", "help": "comma-separated list of maintainer email regexes to search for" + }, + { + "longopt": "--orphaned", + "action": "store_true", + "help": "match only orphaned (maintainer-needed) packages" } ) ), -- 2.4.10