Gentoo Archives: gentoo-dev

From: Michael Orlitzky <mjo@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] */*: Mask Py2 only packages
Date: Thu, 25 Jun 2020 11:32:19
Message-Id: da7c256b-0fad-40a1-2f2e-73a7bae6c872@gentoo.org
In Reply to: Re: [gentoo-dev] */*: Mask Py2 only packages by "Michał Górny"
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 " - {} +

Replies

Subject Author
Re: [gentoo-dev] */*: Mask Py2 only packages John Helmert III <jchelmert3@××××××.net>