1 |
On 2020-06-24 16:08, Michał Górny wrote: |
2 |
> |
3 |
> $ git grep -l mgorny@g.o '**/metadata.xml' | cut -d/ -f1-2 | |
4 |
> xargs gpy-py2 2>/dev/null |
5 |
> |
6 |
|
7 |
The big problem with this is that it misses any aliases (like graphics@) |
8 |
that you're a member of. But let's golf; this is POSIX sh, doesn't use |
9 |
grep to parse XML, and takes the maintainer's email address as an argument: |
10 |
|
11 |
REPO=/var/db/repos/gentoo |
12 |
XPATH="/pkgmetadata/maintainer/email[normalize-space(text()) = '${1}']" |
13 |
|
14 |
find -L "${REPO}" \ |
15 |
-mindepth 3 \ |
16 |
-maxdepth 3 \ |
17 |
-name 'metadata.xml' \ |
18 |
-exec sh -c " |
19 |
for f in \"\${@}\"; do |
20 |
xmllint --xpath \"${XPATH}\" \"\${f}\" >/dev/null 2>&1 && \ |
21 |
echo \"\$(dirname -- \"\${f}\")\" | sed \"s:${REPO%/}/::\" |
22 |
done |
23 |
" - {} + |