commit:     621e45af7ca5d45225c14392c53915fcdd011927
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 24 16:46:29 2015 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Fri Apr 24 16:46:29 2015 +0000
URL:        https://gitweb.gentoo.org/proj/qa-scripts.git/commit/?id=621e45af

check_eclasses_eapis.sh: Don't hardcode known EAPIs.

 check_eclasses_eapis.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/check_eclasses_eapis.sh b/check_eclasses_eapis.sh
index 97230f0..218f01a 100755
--- a/check_eclasses_eapis.sh
+++ b/check_eclasses_eapis.sh
@@ -11,7 +11,6 @@ fi
 
 #[[ $(type pquery 2> /dev/null) ]] || exit 1
 
-KNOWN_EAPIS="0 1 2 3 4 5"
 TMPEAPIS="/tmp/$(basename $0).global.$$.tmp"
 TMPECLASS="/tmp/$(basename $0).eclass.$$.tmp"
 REPO_PATH=$(portageq get_repo_path / gentoo)
@@ -39,6 +38,11 @@ find "${REPO_PATH}/metadata/md5-cache" -type f -exec awk -F= 
'
        }
        ' '{}' \+ > "${TMPEAPIS}"
 
+KNOWN_EAPIS=$(awk '
+       { e = gensub(/eapi="(.*)"/, "\\1", "", $2); eapi[e] = e }
+       END { PROCINFO["sorted_in"]="@ind_num_asc"; for (e in eapi) print e }
+       ' "${TMPEAPIS}")
+
 pushd ${DIR} > /dev/null
 rm -rf *.eclass
 for x in ${ECLASSES}; do

Reply via email to