aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-03-19 19:59:56 +0000
committerSam James <sam@gentoo.org>2022-03-19 20:00:52 +0000
commit555b795d6313fbda8c94429377b05341effc8577 (patch)
tree96803485c49ee0a5f88e0d477d7a3b9c0cec4b97 /eapi-usage.sh
parenteapi-usage.sh: fully respect ${REPO_PATH} (diff)
downloadqa-scripts-555b795d6313fbda8c94429377b05341effc8577.tar.gz
qa-scripts-555b795d6313fbda8c94429377b05341effc8577.tar.bz2
qa-scripts-555b795d6313fbda8c94429377b05341effc8577.zip
eapi-usage.sh: only list EAPIs seen in tree
Means we avoid e.g. EAPI 0 but also EAPIs never in ::gentoo like 5-progress. Much less noisy, anyway. Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'eapi-usage.sh')
-rwxr-xr-xeapi-usage.sh18
1 files changed, 5 insertions, 13 deletions
diff --git a/eapi-usage.sh b/eapi-usage.sh
index 8706fb8..1366d8f 100755
--- a/eapi-usage.sh
+++ b/eapi-usage.sh
@@ -15,12 +15,9 @@ fi
REPO_PATH=$(portageq get_repo_path ${EROOT:-/} gentoo || exit 1)
-mkdir -p ${dir} || exit 1
+shopt -s nullglob
-ebegin "Getting list of supported EAPIs"
-eapi_list=$(python3 -c 'import portage.repository.config; print("\n".join(list(portage._supported_eapis)))' || exit 1)
-eend $?
-einfo "EAPI list:" ${eapi_list}
+mkdir -p ${dir} || exit 1
TMPDIR="$(mktemp -d || exit 1)"
@@ -29,11 +26,6 @@ pushd "${TMPDIR}" &>/dev/null || exit 1
mkdir -p eapi-usage || exit 1
cd eapi-usage || exit 1
-for eapi in ${eapi_list[@]} ; do
- [[ -f ${eapi}.txt ]] && rm -r ${eapi}.txt
- touch ${eapi}.txt
-done
-
ebegin "Finding ebuilds"
(
for ebuild in $(find "${REPO_PATH}/metadata/md5-cache" -mindepth 2 -maxdepth 2 -type f -name '*-[0-9]*') ; do
@@ -46,9 +38,9 @@ ebegin "Finding ebuilds"
eend ${?}
ebegin "Sorting EAPI files"
-for eapi in ${eapi_list[@]} ; do
- sort -u ${eapi}.txt > ${eapi}.txt.sorted
- mv ${eapi}.txt.sorted ${eapi}.txt
+for eapi in *.txt ; do
+ sort -u ${eapi} > ${eapi}.sorted
+ mv ${eapi}.sorted ${eapi}
done || { eend $? || exit 1; }
eend $?