mirror of
https://codeberg.org/kiss-community/kiss
synced 2024-12-24 16:10:05 -07:00
kiss-graph: new utility. Closes #197
Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
This commit is contained in:
parent
2b6384d1a3
commit
b93e6b4ba8
18
contrib/kiss-graph
Executable file
18
contrib/kiss-graph
Executable 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
|
Loading…
Reference in New Issue
Block a user