1
0
mirror of https://codeberg.org/kiss-community/kiss synced 2024-12-23 23:50:05 -07:00

kiss-graph: new utility. Closes #197

This commit is contained in:
Dylan Araps 2020-10-30 09:27:07 +02:00
parent 9818c0866e
commit 8d50eea3b2
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E

18
contrib/kiss-graph Executable file
View File

@ -0,0 +1,18 @@
#!/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
printf '%10s %s\n' "$num" "$pkg"
done