FS#17523 - package name is truncated, should shorten the percentage bar instead

Attached to Project: Pacman
Opened by Gary James (gazj) - Tuesday, 15 December 2009, 21:01 GMT
Last edited by Allan McRae (Allan) - Saturday, 03 July 2010, 09:51 GMT
Task Type Feature Request
Category Output
Status Closed
Assigned To Xavier (shining)
Architecture All
Severity Medium
Priority Normal
Reported Version 3.3.3
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Summary and Info:

When using a terminal full screen, the package name is truncated during download, the percentage bar should be shortened to make more room for the package name.

Steps to Reproduce:

Pacman -Syu

libmsn-4.0beta8-2-i686 357.9K 92.8K/s 00:00:04 [##################################################################] 100%
xf86-input-evdev-2.... 24.8K 97.3K/s 00:00:00 [##################################################################] 100%
xorg-server-1.7.3.9... 3.8M 117.6K/s 00:00:33 [##################################################################] 100%
This task depends upon

Closed by  Allan McRae (Allan)
Saturday, 03 July 2010, 09:51 GMT
Reason for closing:  Fixed
Additional comments about closing:  git commit e4be3e06
Comment by Xavier (shining) - Tuesday, 15 December 2009, 21:52 GMT
Looking at the code, and a sample output, it looks like we always use 50 width for the text part of the progress bar. Both for download and install/upgrade.
I am wondering, maybe it looks nicer this way to have the same width for both, so that everything is aligned ?

The problem, as you can see in the output below, is that we put much more stuff in the download text. The text part of upgrade line is only half filled. But the text part of download is completely filled *and* the filename is cut. This is clearly not ideal. I am interested in improving that, but not sure what decision to take, and how to compute the text width in both cases.
And clearly, when the terminal is wider, it makes more sense to increase the text width rather than just progressbar length.

What about using 50% of terminal width, but imposing a minimum of 50 and maximum of 80 or something ?

:: Retrieving packages from extra...
cpufrequtils-006-4-... 43.8K 109.6K/s 00:00:00 [####################################################################################] 100%
checking package integrity...
(1/1) checking for file conflicts [####################################################################################] 100%
(1/1) upgrading cpufrequtils [####################################################################################] 100%
Comment by Gary James (gazj) - Tuesday, 15 December 2009, 23:02 GMT
I agree that they should stay aligned, but the width of the progress bar should be determined by the width of the terminal, example 30%, the remainder should be used for the package description, but should still truncate if needed. At least then in full screen you will most likely get a full name 90% of the time.

This problem has become more apparent now that package filenames now contain -i686- you very often cannot see the version number of the package being downloaded.

That is what I had in mind at least, your views?
Comment by Xavier (shining) - Wednesday, 16 December 2009, 13:12 GMT Comment by Gary James (gazj) - Wednesday, 16 December 2009, 22:21 GMT
Wehey, well done you :)
Comment by Xilon (Xilon) - Saturday, 03 July 2010, 09:43 GMT
Was the patch accepted? The task should be closed if so.

Loading...