From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-639236-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id 582E8138247
	for <garchives@archives.gentoo.org>; Sat,  2 Nov 2013 13:03:13 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 2B2CFE0ADE;
	Sat,  2 Nov 2013 13:03:08 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id C1C34E0ADE
	for <gentoo-commits@lists.gentoo.org>; Sat,  2 Nov 2013 13:03:07 +0000 (UTC)
Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163])
	(using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id DBFDD33EF86
	for <gentoo-commits@lists.gentoo.org>; Sat,  2 Nov 2013 13:03:06 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by hornbill.gentoo.org (Postfix) with ESMTP id 838C2E54CE
	for <gentoo-commits@lists.gentoo.org>; Sat,  2 Nov 2013 13:03:05 +0000 (UTC)
From: "Ulrich Müller" <ulm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" <ulm@gentoo.org>
Message-ID: <1383397416.020c6e4b79cb0f612c99f8321c484b10d005a16c.ulm@gentoo>
Subject: [gentoo-commits] proj/qa-scripts:master commit in: /
X-VCS-Repository: proj/qa-scripts
X-VCS-Files: eapi_usage.sh
X-VCS-Directories: /
X-VCS-Committer: ulm
X-VCS-Committer-Name: Ulrich Müller
X-VCS-Revision: 020c6e4b79cb0f612c99f8321c484b10d005a16c
X-VCS-Branch: master
Date: Sat,  2 Nov 2013 13:03:05 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Archives-Salt: be251bf2-3cd0-42fa-b428-e5e91e201556
X-Archives-Hash: 0c860c839e74cd9de7b4c94efa8439bf

commit:     020c6e4b79cb0f612c99f8321c484b10d005a16c
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sat Nov  2 13:03:36 2013 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sat Nov  2 13:03:36 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/qa-scripts.git;a=commit;h=020c6e4b

Replace pinspect by manual scanning of md5-cache.

Previous version can be restored when pkgcore will catch up on EAPI 5.

---
 eapi_usage.sh | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/eapi_usage.sh b/eapi_usage.sh
index 5b6a4c8..1e8b5f0 100755
--- a/eapi_usage.sh
+++ b/eapi_usage.sh
@@ -3,8 +3,25 @@
 # Boring 'script' that just uses pkgcore's pinspect command. Someday it would be
 # nice to graph this output, or maybe keep some running history?
 
-[[ $(type pinspect 2> /dev/null) ]] || exit 1
+#[[ $(type pinspect 2> /dev/null) ]] || exit 1
+#
+#pinspect eapi_usage /usr/portage
+
+find /usr/portage/metadata/md5-cache -type f -exec awk '
+    BEGINFILE { found=0 }
+    /^EAPI=/ { sub("EAPI=",""); eapi[$1]++; found=1; nextfile }
+    ENDFILE { if (!found) eapi[0]++ }
+    END { for (i in eapi) print i,eapi[i] }
+  ' '{}' '+' | awk '
+    { eapi[$1]+=$2; total+=$2 }
+    END {
+      for (i in eapi) {
+        s=""; for (j=1; j<eapi[i]*50./total+0.5; j++) s=s"#"
+        printf "EAPI %s: %7d ebuilds (%5.02f%%)  %s\n",
+               i, eapi[i], eapi[i]*100.0/total, s
+       }
+       printf "total:  %7d ebuilds\n", total
+    }'
 
-pinspect eapi_usage /usr/portage
 echo
 echo "Date generated: $(date)"