FS#59201 - Download speed displayed in a non-standard, unclear format

Attached to Project: Pacman
Opened by Severo Raz (severoraz) - Sunday, 01 July 2018, 14:11 GMT
Last edited by Eli Schwartz (eschwartz) - Friday, 11 October 2019, 19:42 GMT
Task Type Bug Report
Category Output
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version 5.1.0
Due in Version 5.2.0
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Summary and Info:
The download speed display format, shown when pacman is downloading packages or package updates prior to their installation, is non-standard and unclear.
At least when the speed is in the scale of megabytes per second, the unit shows as "M/s", which is a problem because:
1) "M" is not really a unit, just a unit prefix which means "mega" and corresponds to 1000² units (of which the type is not specified), and
2) even if one should guess the unit, it is unclear whether it would be bytes or bits (download speeds are frequently given in bits per second and multiples thereof), and whether the prefix itself should be interpreted as "mega" (1000² bytes) or as "mebi" (1024² bytes).

Steps to Reproduce:
1. Download a package, and
2. observe the download speed display format.
This task depends upon

Closed by  Eli Schwartz (eschwartz)
Friday, 11 October 2019, 19:42 GMT
Reason for closing:  Fixed
Additional comments about closing:  https://git.archlinux.org/pacman.git/com mit/?id=adb961a88e6644d5edb16cfcb5dbd1f0 2e4a1781
Comment by Nikola Bunjevac (nbunjevac) - Saturday, 15 September 2018, 10:40 GMT
I've looked at the code, and it's using function humanize_size() from util.c which provides a label with correct unit (B, KiB, MiB...), but the download rate output is using just the first character of the label, hence only "M" is displayed instead of "MiB".

There's also a lot of care with respect to number of screen columns, so maybe there's a deeper reason why only one character is displayed.

I agree that it should either display whole unit ("MiB" instead of "M"), or there should be a notice somewhere about which unit is being used.

Maybe I could attempt this if there's no one else willing to do it at the moment. :D
Comment by Severo Raz (severoraz) - Saturday, 09 February 2019, 08:48 GMT
Hi Nikola, thanks for looking into this! If you don't have enough time to do this yourself, could we have a chat and I'll try to fix it myself?
Comment by Nikola Bunjevac (nbunjevac) - Saturday, 09 February 2019, 10:09 GMT
Sure, go ahead! :-)
Comment by Severo Raz (severoraz) - Friday, 15 February 2019, 19:51 GMT
A branch has been created with the solution to this bug [1], and the patch has been sent to pacman-dev@archlinux.org (pacman development mailing list).

[1] https://github.com/severoraz/bug-pacman-FS59201/tree/bugfix
Comment by Severo Raz (severoraz) - Sunday, 24 February 2019, 14:48 GMT
Solution has been included in commit adb961a88e6644d5edb16cfcb5dbd1f02e4a1781 in the official pacman repository branch, version v5.1.1-139-gadb961a8.

Loading...