1 |
Per GLEP 67, orphaned packages do not have a <maintainer> in metadata.xml. |
2 |
They can't be matched using '--maintainer-email=maintainer-needed@g.o' |
3 |
anymore. Add a new command line argument '--orphaned' to match the orphaned |
4 |
packages. |
5 |
|
6 |
Signed-off-by: Göktürk Yüksek <gokturk@××××××××××.edu> |
7 |
--- |
8 |
bin/portageq | 13 +++++++++++++ |
9 |
1 file changed, 13 insertions(+) |
10 |
|
11 |
diff --git a/bin/portageq b/bin/portageq |
12 |
index 925640b..8ec81ea 100755 |
13 |
--- a/bin/portageq |
14 |
+++ b/bin/portageq |
15 |
@@ -1028,6 +1028,12 @@ class HerdMatcher(object): |
16 |
herds = self._herds |
17 |
return any(x in herds for x in metadata_xml.herds()) |
18 |
|
19 |
+class OrphanedMatcher(object): |
20 |
+ def __call__(self, metadata_xml): |
21 |
+ if not metadata_xml.maintainers(): |
22 |
+ return True |
23 |
+ else: |
24 |
+ return False |
25 |
|
26 |
def pquery(parser, opts, args): |
27 |
portdb = portage.db[portage.root]['porttree'].dbapi |
28 |
@@ -1090,6 +1096,8 @@ def pquery(parser, opts, args): |
29 |
for x in opts.herd: |
30 |
herds.extend(x.split(",")) |
31 |
xml_matchers.append(HerdMatcher(herds)) |
32 |
+ if opts.orphaned: |
33 |
+ xml_matchers.append(OrphanedMatcher()) |
34 |
|
35 |
if opts.repo is not None: |
36 |
repos = [portdb.repositories[opts.repo]] |
37 |
@@ -1248,6 +1256,11 @@ def add_pquery_arguments(parser): |
38 |
"longopt": "--maintainer-email", |
39 |
"action": "append", |
40 |
"help": "comma-separated list of maintainer email regexes to search for" |
41 |
+ }, |
42 |
+ { |
43 |
+ "longopt": "--orphaned", |
44 |
+ "action": "store_true", |
45 |
+ "help": "match only orphaned (maintainer-needed) packages" |
46 |
} |
47 |
) |
48 |
), |
49 |
-- |
50 |
2.4.10 |