diff options
author | Sever Oraz <severoraz@gmail.com> | 2019-02-12 23:27:05 +0100 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2019-02-21 05:55:49 +0100 |
commit | adb961a88e6644d5edb16cfcb5dbd1f02e4a1781 (patch) | |
tree | 1dce04eef16ee9c86f2d116b0076421aca1bb951 /src | |
parent | ba7a41031c201b20d26cb69aa8b25acfb55c56bd (diff) | |
download | pacman-adb961a88e6644d5edb16cfcb5dbd1f02e4a1781.tar.gz pacman-adb961a88e6644d5edb16cfcb5dbd1f02e4a1781.tar.xz |
Use standard, consistent units in the download progress.
Rather than use M/s which can be either MB or MiB, specify that it uses
MiB (consistent with the displayed total size).
Fixes FS#59201
Signed-off-by: Sever Oraz <severoraz@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/pacman/callback.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/pacman/callback.c b/src/pacman/callback.c index ee75297c..40e7832c 100644 --- a/src/pacman/callback.c +++ b/src/pacman/callback.c @@ -800,9 +800,9 @@ void cb_dl_progress(const char *filename, off_t file_xfered, off_t file_total) fname[len] = '\0'; /* 1 space + filenamelen + 1 space + 6 for size + 1 space + 3 for label + - * + 2 spaces + 4 for rate + 1 for label + 2 for /s + 1 space + - * 8 for eta, gives us the magic 30 */ - filenamelen = infolen - 30; + * + 2 spaces + 4 for rate + 1 space + 3 for label + 2 for /s + 1 space + + * 8 for eta, gives us the magic 33 */ + filenamelen = infolen - 33; /* see printf() code, we omit 'HH:' in these conditions */ if(eta_h == 0 || eta_h >= 100) { filenamelen += 3; @@ -837,16 +837,16 @@ void cb_dl_progress(const char *filename, off_t file_xfered, off_t file_total) xfered_human = humanize_size(xfered, '\0', -1, &xfered_label); printf(" %ls%-*s ", wcfname, padwid, ""); - /* We will show 1.62M/s, 11.6M/s, but 116K/s and 1116K/s */ + /* We will show 1.62 MiB/s, 11.6 MiB/s, but 116 KiB/s and 1116 KiB/s */ if(rate_human < 9.995) { - printf("%6.1f %3s %4.2f%c/s ", - xfered_human, xfered_label, rate_human, rate_label[0]); + printf("%6.1f %3s %4.2f %3s/s ", + xfered_human, xfered_label, rate_human, rate_label); } else if(rate_human < 99.95) { - printf("%6.1f %3s %4.1f%c/s ", - xfered_human, xfered_label, rate_human, rate_label[0]); + printf("%6.1f %3s %4.1f %3s/s ", + xfered_human, xfered_label, rate_human, rate_label); } else { - printf("%6.1f %3s %4.f%c/s ", - xfered_human, xfered_label, rate_human, rate_label[0]); + printf("%6.1f %3s %4.f %3s/s ", + xfered_human, xfered_label, rate_human, rate_label); } if(eta_h == 0) { printf("%02u:%02u", eta_m, eta_s); |