summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2011-05-28 17:21:34 +0200
committerPierre Schmitz <pierre@archlinux.de>2011-05-28 17:21:34 +0200
commitc0c0c83e2715dd7528bc8f0e91b94fdb6b21910e (patch)
treefb9858163fafc69ab1256e9603fba9cb42375f2d
parentae7630ec64951dad1a4ffd6f98917f3e3ea9cf4d (diff)
downloadrepo-tools-c0c0c83e2715dd7528bc8f0e91b94fdb6b21910e.tar.gz
repo-tools-c0c0c83e2715dd7528bc8f0e91b94fdb6b21910e.tar.xz
add a simple statistics script
-rwxr-xr-xstats25
1 files changed, 25 insertions, 0 deletions
diff --git a/stats b/stats
new file mode 100755
index 0000000..b6ab3a6
--- /dev/null
+++ b/stats
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+home="$(dirname "$(readlink -f $0)")"
+repo="${home}/repo"
+
+totalPackages=$(find ${repo} -type f -name '*.pkg.tar.?z' | wc -l)
+
+gzPackages=$(find ${repo} -type f -name '*.pkg.tar.gz' | wc -l)
+gzPercentage=$(echo "scale=4; ${gzPackages}/${totalPackages}*100" | bc)
+
+xzPackages=$(find ${repo} -type f -name '*.pkg.tar.xz' | wc -l)
+xzPercentage=$(echo "scale=4; ${xzPackages}/${totalPackages}*100" | bc)
+
+signedPackages=$(find ${repo} -type f -name '*.pkg.tar.?z.sig' | wc -l)
+signedPercentage=$(echo "scale=4; ${signedPackages}/${totalPackages}*100" | bc)
+
+pooledPackages=$(find ${repo}/pool -type f -name '*.pkg.tar.?z' | wc -l)
+pooledPercentage=$(echo "scale=4; ${pooledPackages}/${totalPackages}*100" | bc)
+
+echo -e "\t\tpackages\tpercentage"
+echo -e "total\t\t${totalPackages}"
+echo -e "pooled\t\t${pooledPackages}\t\t${pooledPercentage}%"
+echo -e "xz\t\t${xzPackages}\t\t${xzPercentage}%"
+echo -e "gzip\t\t${gzPackages}\t\t${gzPercentage}%"
+echo -e "signed\t\t${signedPackages}\t\t${signedPercentage}%"