1 |
On 05/11/16 01:20, Rich Freeman wrote: |
2 |
> On Fri, Nov 4, 2016 at 8:30 PM, M. J. Everitt <m.j.everitt@×××.org> wrote: |
3 |
>> Apologies, getting ahead of myself here .. there must be a portage |
4 |
>> utility, but I've forgotten which one interrogates metadata .. I'll |
5 |
>> defer to a more authoritative source ... |
6 |
>> |
7 |
> There might be a command line utility if you're doing things the shell way. |
8 |
> |
9 |
> But, from that python script I linked the relevant part is: |
10 |
> |
11 |
> from portage.xml.metadata import MetaDataXML |
12 |
> |
13 |
> metxml = path+"/"+category+"/"+pkgname+"/metadata.xml" |
14 |
> maints=[] |
15 |
> try: |
16 |
> pkg_md = MetaDataXML(metxml,"/usr/portage/metadata/herds.xml") |
17 |
> for maint in pkg_md.maintainers(): |
18 |
> maints.append(maint.email) |
19 |
> except IOError: pass |
20 |
> |
21 |
> Just feed that api call with a metadata.xml. Hopefuly it works with |
22 |
> the projects.xml syntax as herds.xml is of course defunct. I'd |
23 |
> check the portage API docs as there might be some improvements there. |
24 |
> |
25 |
> The portage api is actually fairly powerful and far superior to a lot |
26 |
> of stuff that gets done with grep. It just needs a bit of time |
27 |
> getting used to it since there aren't a lot of docs/examples/etc |
28 |
> floating around. The script that came out of was designed to find |
29 |
> packages that depend on packages that expose subslots but which don't |
30 |
> define slot operator deps. Granted, not everything in that list |
31 |
> should be using them, and by now I imagine it is almost entirely false |
32 |
> positives, but it shows the sort of thing you can do with a couple of |
33 |
> lines of python that would be an incredible pain to do any other way. |
34 |
> I believe paludis also exposes some APIs that probably could also be |
35 |
> used. |
36 |
> |
37 |
Bit beyond my python-fu .. but I get where you're going with that. If I |
38 |
wasn't banging my head against cups/hplip, I might give it a shot ... :P !! |