Gentoo Archives: gentoo-commits

From: "Ulrich Müller" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/qa-scripts:master commit in: /
Date: Sat, 02 Nov 2013 13:03:13
Message-Id: 1383397416.020c6e4b79cb0f612c99f8321c484b10d005a16c.ulm@gentoo
1 commit: 020c6e4b79cb0f612c99f8321c484b10d005a16c
2 Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
3 AuthorDate: Sat Nov 2 13:03:36 2013 +0000
4 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
5 CommitDate: Sat Nov 2 13:03:36 2013 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/qa-scripts.git;a=commit;h=020c6e4b
7
8 Replace pinspect by manual scanning of md5-cache.
9
10 Previous version can be restored when pkgcore will catch up on EAPI 5.
11
12 ---
13 eapi_usage.sh | 21 +++++++++++++++++++--
14 1 file changed, 19 insertions(+), 2 deletions(-)
15
16 diff --git a/eapi_usage.sh b/eapi_usage.sh
17 index 5b6a4c8..1e8b5f0 100755
18 --- a/eapi_usage.sh
19 +++ b/eapi_usage.sh
20 @@ -3,8 +3,25 @@
21 # Boring 'script' that just uses pkgcore's pinspect command. Someday it would be
22 # nice to graph this output, or maybe keep some running history?
23
24 -[[ $(type pinspect 2> /dev/null) ]] || exit 1
25 +#[[ $(type pinspect 2> /dev/null) ]] || exit 1
26 +#
27 +#pinspect eapi_usage /usr/portage
28 +
29 +find /usr/portage/metadata/md5-cache -type f -exec awk '
30 + BEGINFILE { found=0 }
31 + /^EAPI=/ { sub("EAPI=",""); eapi[$1]++; found=1; nextfile }
32 + ENDFILE { if (!found) eapi[0]++ }
33 + END { for (i in eapi) print i,eapi[i] }
34 + ' '{}' '+' | awk '
35 + { eapi[$1]+=$2; total+=$2 }
36 + END {
37 + for (i in eapi) {
38 + s=""; for (j=1; j<eapi[i]*50./total+0.5; j++) s=s"#"
39 + printf "EAPI %s: %7d ebuilds (%5.02f%%) %s\n",
40 + i, eapi[i], eapi[i]*100.0/total, s
41 + }
42 + printf "total: %7d ebuilds\n", total
43 + }'
44
45 -pinspect eapi_usage /usr/portage
46 echo
47 echo "Date generated: $(date)"