kisslinux / kiss

KISS Linux - Package Manager
https://kisslinux.github.io
MIT License
464 stars 62 forks source link

kiss-graph: list all packages by size #197

Closed TAAPArthur closed 4 years ago

TAAPArthur commented 4 years ago

I was looking for functionality like Arch's pacgraph where all installed packages would be listed by size. This patch adds a kiss extension that uses kiss-size to achieve similar functionality.

Since the default sort doesn't have an option to compare human readable numbers, an environmental var was added to kiss-size such that when it is set, the size is KB will be printed too so kiss-graph can use it to sort.

Example output:

137MB   gcc
44MB    perl
37MB    python
29MB    vim
27MB    binutils 
...
dylanaraps commented 4 years ago

Pushed a similar version to master. It prints two columns, first is total size in KB and second is package name. When no arguments are given, all installed packages are listed. Arguments can be passed to output sizes for selected packages. This output can be made human readable via command-line utilities for now (the important thing is that it can now be sorted).

Both this utility and kiss-size are flawed (and frankly, quite slow). I think these are a better fit for C and I'll write equivalent utilities alongside the C package manager which is also coming (soon).

Thanks for the PR