public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Göktürk Yüksek" <gokturk@binghamton.edu>
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	[thread overview]
Message-ID: <1457161726-6649-1-git-send-email-gokturk@binghamton.edu> (raw)

Per GLEP 67, orphaned packages do not have a <maintainer> 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 <gokturk@binghamton.edu>
---
 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



             reply	other threads:[~2016-03-06 12:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-05  7:08 Göktürk Yüksek [this message]
2016-03-07 12:19 ` [gentoo-portage-dev] [PATCH] bin/portageq: add a matcher to match the orphaned (maintainer-needed) packages Alexander Berntsen
2016-03-07 17:15   ` Zac Medico
2016-03-08 13:27     ` Alexander Berntsen
2016-03-08 14:46       ` Brian Dolbec
2016-03-08 14:49         ` Alexander Berntsen
  -- strict thread matches above, loose matches on Subject: below --
2016-03-05  7:36 Göktürk Yüksek
2016-03-06 15:12 ` Brian Dolbec
2016-03-07 12:24   ` Alexander Berntsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1457161726-6649-1-git-send-email-gokturk@binghamton.edu \
    --to=gokturk@binghamton.edu \
    --cc=gentoo-portage-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox