commit:     4dae15d9b786650329fa92f9a7ddc0116e6f5acc
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 19 19:43:07 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Mar 19 19:43:07 2022 +0000
URL:        https://gitweb.gentoo.org/proj/qa-scripts.git/commit/?id=4dae15d9

eapi-usage.sh: rename from eapi_usage.sh; absorb check-eapis.sh

Both eapi_usage.sh and check-eapis.sh do very similar things,
so let's combine the two.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 check-eapis.sh => eapi-usage.sh | 26 ++++++++++++++++++++++++++
 eapi_usage.sh                   | 27 ---------------------------
 2 files changed, 26 insertions(+), 27 deletions(-)

diff --git a/check-eapis.sh b/eapi-usage.sh
similarity index 64%
rename from check-eapis.sh
rename to eapi-usage.sh
index 78fa30a..77758bd 100755
--- a/check-eapis.sh
+++ b/eapi-usage.sh
@@ -55,3 +55,29 @@ popd &>/dev/null || exit 1
 mv ${TMPDIR}/eapi-usage/*.txt ${dir}/ || exit 1
 
 rm -r "${TMPDIR}" || exit 1
+
+# Now generate the numbers/summary (copied in from previous eapi_usage.sh 
script)
+# 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
+#
+#pinspect eapi_usage /usr/portage
+echo "<pre>"
+find /usr/portage/metadata/md5-cache -type f ! -name '*.gz' \
+  -exec grep -h '^EAPI=' '{}' + \
+  | awk '
+    { sub("EAPI=",""); eapi[$1]++ }
+    END {
+      PROCINFO["sorted_in"]="@val_num_desc"
+      for (i in eapi) {
+        s=""; for (j=1; j<eapi[i]*50./NR+0.5; j++) s=s"#"
+        printf "EAPI %s: %7d ebuilds (%5.02f%%)  %s\n",
+               i, eapi[i], eapi[i]*100.0/NR, s
+       }
+       printf "total:  %7d ebuilds\n", NR
+    }'
+
+echo
+echo "Date generated: $(date -u '+%Y-%m-%d %H:%M:%S %Z')"
+echo "</pre>"

diff --git a/eapi_usage.sh b/eapi_usage.sh
deleted file mode 100755
index 94bdfcb..0000000
--- a/eapi_usage.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/bash
-
-# 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
-#
-#pinspect eapi_usage /usr/portage
-
-echo "<pre>"
-find /usr/portage/metadata/md5-cache -type f ! -name '*.gz' \
-  -exec grep -h '^EAPI=' '{}' + \
-  | awk '
-    { sub("EAPI=",""); eapi[$1]++ }
-    END {
-      PROCINFO["sorted_in"]="@val_num_desc"
-      for (i in eapi) {
-        s=""; for (j=1; j<eapi[i]*50./NR+0.5; j++) s=s"#"
-        printf "EAPI %s: %7d ebuilds (%5.02f%%)  %s\n",
-               i, eapi[i], eapi[i]*100.0/NR, s
-       }
-       printf "total:  %7d ebuilds\n", NR
-    }'
-
-echo
-echo "Date generated: $(date -u '+%Y-%m-%d %H:%M:%S %Z')"
-echo "</pre>"

Reply via email to