public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] bin/portageq: add a matcher to match the orphaned (maintainer-needed) packages
@ 2016-03-05 21:22 Göktürk Yüksek
  0 siblings, 0 replies; only message in thread
From: Göktürk Yüksek @ 2016-03-05 21:22 UTC (permalink / raw)
  To: dev-portage; +Cc: gentoo-dev

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



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-03-06 12:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-05 21:22 [gentoo-dev] [PATCH] bin/portageq: add a matcher to match the orphaned (maintainer-needed) packages Göktürk Yüksek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox