aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Chvatal <scarabeus@gentoo.org>2011-02-10 12:55:40 +0100
committerTomas Chvatal <scarabeus@gentoo.org>2011-02-10 12:55:40 +0100
commit9acef7704caf19747791cd56b3c3072a1369b285 (patch)
tree552ea92eaad820df1c967774621f2f5b60fa70ac /check_eclasses_eapis.sh
downloadqa-scripts-9acef7704caf19747791cd56b3c3072a1369b285.tar.gz
qa-scripts-9acef7704caf19747791cd56b3c3072a1369b285.tar.bz2
qa-scripts-9acef7704caf19747791cd56b3c3072a1369b285.zip
Add few scripts of mine so it is not that empty
portqa: scan qa on ebuilds based on specified herd portdel: delete all files passed as arguments from cvs portcommit: just wrapper that runs echangelog+repoman check_eclasses_eapis.sh: check eapi distribution for all eclasses Note: portqa and check_eclasses require pkgcore stuff.
Diffstat (limited to 'check_eclasses_eapis.sh')
-rwxr-xr-xcheck_eclasses_eapis.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/check_eclasses_eapis.sh b/check_eclasses_eapis.sh
new file mode 100755
index 0000000..ef25d5d
--- /dev/null
+++ b/check_eclasses_eapis.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+# Created by Tomáš Chvátal <scarabeus@gentoo.org>
+# License WTFPL-2.0
+
+KNOWN_EAPIS="0 1 2 3 4"
+TMPEAPIS="/tmp/$(basename $0).global.$$.tmp"
+TMPECLASS="/tmp/$(basename $0).eclass.$$.tmp"
+pushd "$(portageq portdir)/eclass" > /dev/null
+ECLASSES=$(echo *.eclass)
+popd > /dev/null
+pquery --attr eapi --attr inherited --raw --all --repo portdir > "${TMPEAPIS}"
+
+rm -rf *.eclass
+for x in ${ECLASSES}; do
+ echo "Processing eclass \"${x}\""
+ rm -rf "${x}"
+ mkdir "${x}"
+ awk -F'=' '$3 ~ /'"${x%.eclass}"'[ "]/ {print $1" "$2}' "${TMPEAPIS}" > "${TMPECLASS}"
+ pushd "${x}" > /dev/null
+ echo "Overall statistic for eclass \"${x}\":" > "STATS.txt"
+ for y in ${KNOWN_EAPIS}; do
+ awk -F ' ' '$3 ~ /'"${y}"'/ {print $1}' "${TMPECLASS}" > "${y}.txt"
+ tmpval=$(wc -l "${y}.txt" |cut -d' ' -f1)
+ echo "EAPI=${y} count: ${tmpval}" >> "STATS.txt"
+ done
+ popd > /dev/null
+done
+
+rm ${TMPEAPIS}
+rm ${TMPECLASS}