1 |
commit: aa858c1185dfffe26c94eea780d3ccb716723d5f |
2 |
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Aug 24 10:45:15 2014 +0000 |
4 |
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Aug 24 10:45:15 2014 +0000 |
6 |
URL: http://sources.gentoo.org/gitweb/?p=proj/qa-scripts.git;a=commit;h=aa858c11 |
7 |
|
8 |
check_eclasses_eapis.sh: Replace pquery call by find/awk command. |
9 |
|
10 |
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org> |
11 |
|
12 |
--- |
13 |
check_eclasses_eapis.sh | 26 +++++++++++++++++++++++--- |
14 |
1 file changed, 23 insertions(+), 3 deletions(-) |
15 |
|
16 |
diff --git a/check_eclasses_eapis.sh b/check_eclasses_eapis.sh |
17 |
index 86aa083..03349e2 100755 |
18 |
--- a/check_eclasses_eapis.sh |
19 |
+++ b/check_eclasses_eapis.sh |
20 |
@@ -9,15 +9,35 @@ else |
21 |
DIR=$(pwd) |
22 |
fi |
23 |
|
24 |
-[[ $(type pquery 2> /dev/null) ]] || exit 1 |
25 |
+#[[ $(type pquery 2> /dev/null) ]] || exit 1 |
26 |
|
27 |
KNOWN_EAPIS="unsupported 0 1 2 3 4 5" |
28 |
TMPEAPIS="/tmp/$(basename $0).global.$$.tmp" |
29 |
TMPECLASS="/tmp/$(basename $0).eclass.$$.tmp" |
30 |
-pushd "$(portageq get_repo_path / gentoo)/eclass" > /dev/null |
31 |
+REPO_PATH=$(portageq get_repo_path / gentoo) |
32 |
+pushd "${REPO_PATH}/eclass" > /dev/null |
33 |
ECLASSES=$(echo *.eclass) |
34 |
popd > /dev/null |
35 |
-pquery --attr eapi --attr inherited --raw --all --repo portdir > "${TMPEAPIS}" |
36 |
+ |
37 |
+#pquery --attr eapi --attr inherited --raw --all --repo portdir > "${TMPEAPIS}" |
38 |
+find "${REPO_PATH}/metadata/md5-cache" -type f -exec awk -F= ' |
39 |
+ BEGINFILE { |
40 |
+ n = split(FILENAME, f, "/") |
41 |
+ file = f[n-1] "/" f[n] |
42 |
+ eapi = "0" |
43 |
+ n_eclasses = 0 |
44 |
+ } |
45 |
+ $1 == "EAPI" { eapi = $2 } |
46 |
+ $1 == "_eclasses_" { n_eclasses = split($2, eclasses, "\t") } |
47 |
+ ENDFILE { |
48 |
+ printf "%s eapi=\"%s\" inherited=\"", file, eapi |
49 |
+ for (i = 1; i <= n_eclasses; i += 2) { |
50 |
+ if (i != 1) printf " " |
51 |
+ printf "%s", eclasses[i] |
52 |
+ } |
53 |
+ printf "\"\n" |
54 |
+ } |
55 |
+ ' '{}' \+ > "${TMPEAPIS}" |
56 |
|
57 |
pushd ${DIR} > /dev/null |
58 |
rm -rf *.eclass |