summaryrefslogtreecommitdiff
path: root/hack/analyses/go-archive-analysis.sh
diff options
context:
space:
mode:
Diffstat (limited to 'hack/analyses/go-archive-analysis.sh')
-rwxr-xr-xhack/analyses/go-archive-analysis.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/hack/analyses/go-archive-analysis.sh b/hack/analyses/go-archive-analysis.sh
new file mode 100755
index 000000000..8f3a110d6
--- /dev/null
+++ b/hack/analyses/go-archive-analysis.sh
@@ -0,0 +1,15 @@
+#!/usr/bin/bash
+
+if [ -z "$WORK" ]
+then
+ echo "WORK environment variable must be set"
+ exit 1
+fi
+
+DATA=$(grep --no-filename packagefile $WORK/**/importcfg \
+ | awk '{ split($2, data, "="); printf "%s ", data[1]; system("du -sh " data[2]) }' \
+ | awk '{ printf "%s %s\n", $2, $1 }' \
+ | sort -ruh \
+ )
+
+echo "$DATA"