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