public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-portage-dev] [PATCH] bin/portageq: add a matcher to match the orphaned (maintainer-needed) packages
@ 2016-03-05  7:08 Göktürk Yüksek
  2016-03-07 12:19 ` Alexander Berntsen
  0 siblings, 1 reply; 9+ messages in thread
From: Göktürk Yüksek @ 2016-03-05  7:08 UTC (permalink / raw
  To: gentoo-portage-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] 9+ messages in thread
* [gentoo-portage-dev] [PATCH] bin/portageq: add a matcher to match the orphaned (maintainer-needed) packages
@ 2016-03-05  7:36 Göktürk Yüksek
  2016-03-06 15:12 ` Brian Dolbec
  0 siblings, 1 reply; 9+ messages in thread
From: Göktürk Yüksek @ 2016-03-05  7:36 UTC (permalink / raw
  To: gentoo-portage-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] 9+ messages in thread

end of thread, other threads:[~2016-03-08 14:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-05  7:08 [gentoo-portage-dev] [PATCH] bin/portageq: add a matcher to match the orphaned (maintainer-needed) packages Göktürk Yüksek
2016-03-07 12:19 ` 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

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