kiss/contrib/kiss-graph

19 lines
343 B
Plaintext
Raw Permalink Normal View History

#!/bin/sh -e
# list all packages by size
cd "$KISS_ROOT/var/db/kiss/installed"
[ "$1" ] || set -- *
for pkg do
sum=$(kiss size "$pkg" 2>&1 >/dev/null)
num=${sum%%[A-Z][A-Z] *}
case ${sum%% *} in
*MB) num=$((num * 1024)) ;;
*GB) num=$((num * 1024 * 1024)) ;;
esac
2020-11-05 23:16:58 -07:00
printf '%10s %s\n' "$num" "$pkg"
done