xbps icon indicating copy to clipboard operation
xbps copied to clipboard

FR: Improve output of package sizes in `xbps-install` and `xbps-remove`

Open camoz opened this issue 2 years ago • 0 comments

Some ideas to improve readability:

  • [ ] Numbers in the Download size column of xbps-install should be right-aligned to improve readability, as is already the case for the summary output directly before the confirmation prompt.
  • [ ] Ideally for values >= 1024 or >= 2048, the next unit size should be used, to keep the numbers small. Right now it is ca. >= 10000 (9342KB but 11MB).
    • Maybe use decimal numbers with 1 or 2 digits after the comma, to maintain precision.
    • If decimal numbers are used, maybe use them always to maintain readability (see last example below).
  • [ ] Set the smallest unit to KiB (right now it is B which seems unnecessarily small).

Illustration

Right now:

libXtst               install   -                 1.2.3_2                9072B
libcups               install   -                 2.3.3op2_1             265KB
libusb                install   -                 1.0.24_2               51KB
libgusb               install   -                 0.3.7_1                34KB
largepkg              install   -                 1.2.7_1                8625KB

What it could be like (no decimal numbers, some precision lost):

libXtst               install   -                 1.2.3_2                  8 KiB
libcups               install   -                 2.3.3op2_1             265 KiB
libusb                install   -                 1.0.24_2                51 KiB
libgusb               install   -                 0.3.7_1                 34 KiB
largepkg              install   -                 1.2.7_1                  9 MiB

Alternatively with decimal numbers used everywhere (pacman right now does this; output copied from pacman):

extra/solid                     5.89.0-1                  2.62 MiB               
extra/syndication               5.89.0-1                  2.39 MiB               
extra/udisks2                   2.9.4-1                  13.82 MiB               
extra/upower                    0.99.13-1                 0.95 MiB               
extra/usbmuxd                   1.1.1-1                   0.08 MiB               
extra/volume_key                0.3.12-7                  0.79 MiB               
extra/kdenlive                  21.12.0-1                66.37 MiB

It seems pacman only uses MiB. With this, it's easier to spot very large/small packages, at the cost of precision. One does not have to look for KiB vs MiB.

PS: In the illustrations above I assume that https://github.com/void-linux/xbps/issues/445 is fixed, i.e. 23 KiB instead of 23KB.

camoz avatar Dec 26 '21 03:12 camoz