Package: debian-goodies
Version: 0.87
Severity: wishlist
File: /usr/bin/dpigs
Tags: patch

Just a suggestion, but numfmt is super awesome and obviates the awk blob.

      fi | if [ $HUMAN -eq 1 ]; then
    -     awk '{ if ($1 > 1024*1024*1024)
    -               printf("% 6.1fT %s\n", $1/(1024*1024*1024), $2);
    -            else if ($1 > 1024*1024)
    -               printf("% 6.1fG %s\n", $1/(1024*1024), $2);
    -            else if ($1 > 1024)
    -               printf("% 6.1fM %s\n", $1/1024, $2);
    -            else
    -               printf("% 6.1ik %s\n", $1, $2); }'
    +     numfmt --from-unit=Ki --to=iec-i --suffix=B --padding=6


Proof of concept:

    bash5$ dpigs -H
     326.4M fonts-noto-extra
     287.6M linux-image-5.10.0-8-amd64
     287.5M linux-image-5.10.0-7-amd64
     209.1M llvm-11-dev
     204.9M fonts-noto-cjk-extra
     204.9M firefox
     195.3M firefox-esr
     194.1M ansible
     188.0M chromium
     178.3M ansible-doc

    bash5$ dpigs | numfmt --from-unit=Ki --to=iec-i --suffix=B --padding=6
    327MiB fonts-noto-extra
    288MiB linux-image-5.10.0-8-amd64
    288MiB linux-image-5.10.0-7-amd64
    210MiB llvm-11-dev
    205MiB fonts-noto-cjk-extra
    205MiB firefox
    196MiB firefox-esr
    195MiB ansible
    189MiB chromium
    179MiB ansible-doc




-- System Information:
Debian Release: 11.0
  APT prefers stable
  APT policy: (990, 'stable'), (500, 'stable-security'), (500, 
'proposed-updates'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-8-amd64 (SMP w/8 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_WARN, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

debian-goodies depends on no packages.

Versions of packages debian-goodies recommends:
ii  apt                        2.2.4
ii  curl                       7.74.0-1.3+b1
ii  dctrl-tools                2.24-3+b1
ii  elfutils                   0.183-1
ii  equivs                     2.3.1
ii  libfile-slurper-perl       0.012-1
ii  libfile-which-perl         1.23-1
ii  libipc-system-simple-perl  1.30-1
ii  man-db                     2.9.4-2
ii  perl                       5.32.1-4
ii  popularity-contest         1.71
ii  procps                     2:3.3.17-5
ii  python3                    3.9.2-3
ii  sensible-utils             0.0.14
ii  whiptail                   0.52.21-4+b3
ii  zenity                     3.32.0-6

Versions of packages debian-goodies suggests:
ii  apt-file                   3.2.2
ii  chromium [www-browser]     90.0.4430.212-1
ii  firefox [www-browser]      88.0.1-1
ii  firefox-esr [www-browser]  78.12.0esr-1
pn  konqueror                  <none>
ii  lsb-release                11.1.0
ii  lsof                       4.93.2+dfsg-1.1
ii  lynx [www-browser]         2.9.0dev.6-2
ii  midori [www-browser]       7.0-2.1
ii  netrik [www-browser]       1.16.1-2+b2
ii  openssh-client             1:8.4p1-5
ii  sudo                       1.9.5p2-3
ii  w3m [www-browser]          0.5.3+git20210102-6
ii  xdg-utils                  1.1.3-4.1

-- no debconf information

Reply via email to