aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2014-08-24 12:45:15 +0200
committerUlrich Müller <ulm@gentoo.org>2014-08-24 12:45:15 +0200
commitaa858c1185dfffe26c94eea780d3ccb716723d5f (patch)
tree5396d39f8bbfd502c3bcd981af0396c1eb3f9674 /check_eclasses_eapis.sh
parentfind-binary-files.sh: Remove false positives for GNU Info files. (diff)
downloadqa-scripts-aa858c1185dfffe26c94eea780d3ccb716723d5f.tar.gz
qa-scripts-aa858c1185dfffe26c94eea780d3ccb716723d5f.tar.bz2
qa-scripts-aa858c1185dfffe26c94eea780d3ccb716723d5f.zip
check_eclasses_eapis.sh: Replace pquery call by find/awk command.
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
Diffstat (limited to 'check_eclasses_eapis.sh')
-rwxr-xr-xcheck_eclasses_eapis.sh26
1 files changed, 23 insertions, 3 deletions
diff --git a/check_eclasses_eapis.sh b/check_eclasses_eapis.sh
index 86aa083..03349e2 100755
--- a/check_eclasses_eapis.sh
+++ b/check_eclasses_eapis.sh
@@ -9,15 +9,35 @@ else
DIR=$(pwd)
fi
-[[ $(type pquery 2> /dev/null) ]] || exit 1
+#[[ $(type pquery 2> /dev/null) ]] || exit 1
KNOWN_EAPIS="unsupported 0 1 2 3 4 5"
TMPEAPIS="/tmp/$(basename $0).global.$$.tmp"
TMPECLASS="/tmp/$(basename $0).eclass.$$.tmp"
-pushd "$(portageq get_repo_path / gentoo)/eclass" > /dev/null
+REPO_PATH=$(portageq get_repo_path / gentoo)
+pushd "${REPO_PATH}/eclass" > /dev/null
ECLASSES=$(echo *.eclass)
popd > /dev/null
-pquery --attr eapi --attr inherited --raw --all --repo portdir > "${TMPEAPIS}"
+
+#pquery --attr eapi --attr inherited --raw --all --repo portdir > "${TMPEAPIS}"
+find "${REPO_PATH}/metadata/md5-cache" -type f -exec awk -F= '
+ BEGINFILE {
+ n = split(FILENAME, f, "/")
+ file = f[n-1] "/" f[n]
+ eapi = "0"
+ n_eclasses = 0
+ }
+ $1 == "EAPI" { eapi = $2 }
+ $1 == "_eclasses_" { n_eclasses = split($2, eclasses, "\t") }
+ ENDFILE {
+ printf "%s eapi=\"%s\" inherited=\"", file, eapi
+ for (i = 1; i <= n_eclasses; i += 2) {
+ if (i != 1) printf " "
+ printf "%s", eclasses[i]
+ }
+ printf "\"\n"
+ }
+ ' '{}' \+ > "${TMPEAPIS}"
pushd ${DIR} > /dev/null
rm -rf *.eclass