Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 945271

Summary: app-portage/portage-utils qlop's default duration time hard to read
Product: Gentoo Linux Reporter: Patrick <mail>
Component: Current packagesAssignee: Fabian Groffen <grobian>
Status: IN_PROGRESS ---    
Severity: minor CC: floppym, mail
Priority: Normal Keywords: InVCS, PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: readable-duration-units.patch for qlop
git-format-patch formatted

Description Patrick 2024-11-28 21:09:06 UTC
When running qlop, by default the durations are printed like so:

2024-11-26T23:01:35 >>> dev-vcs/git: 25′38″
2024-11-26T23:01:35 >>> sys-devel/llvm: 25′44″
2024-11-26T23:27:19 >>> sys-apps/lm-sensors: 3′18″

i.e. ' = minutes and " = seconds. I guess in the author's country that's a common way to specify a duration, but I can't remember having ever seen that on my side of the globe.

But additionally, some typographic version of these characters is used that can cause trouble with ASCII locale terminals. Then it looks like this:

2024-11-28T20:59:00 >>> net-nds/openldap: 1â²29â³
2024-11-28T21:00:29 >>> app-misc/pax-utils: 13s

I'm attaching a patch that renders the durations as follows:

2024-11-27T00:55:24 >>> kde-plasma/plasma-browser-integration: 2m39s
2024-11-27T00:55:24 >>> kde-plasma/powerdevil: 2m45s
2024-11-27T00:55:24 >>> kde-plasma/plasma-desktop: 2m52

IMO they're very easy to ready by anyone, perfectly concise, and more compatible on old/broken terminals.

Reproducible: Always
Comment 1 Patrick 2024-11-28 21:10:32 UTC
Created attachment 912555 [details, diff]
readable-duration-units.patch for qlop
Comment 2 Fabian Groffen gentoo-dev 2024-11-29 07:35:21 UTC
fair enough :)
Comment 3 Fabian Groffen gentoo-dev 2024-11-29 07:39:57 UTC
Any chance you can turn that patch into a git format patch that I can apply and record your contribution?  A Signed-off-by would be nice in that case.

Thanks!
Comment 4 Patrick 2024-12-01 14:44:05 UTC
Created attachment 912964 [details, diff]
git-format-patch formatted

Sure :) I haven't done that before, hopefully that's what you need.
Comment 5 Larry the Git Cow gentoo-dev 2024-12-02 07:26:41 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=1833294774ebfb4bcc1464e6ae28e71da0f6babf

commit 1833294774ebfb4bcc1464e6ae28e71da0f6babf
Author:     Patrick Nagel <mail@patrick-nagel.net>
AuthorDate: 2024-12-01 14:40:02 +0000
Commit:     Fabian Groffen <grobian@gentoo.org>
CommitDate: 2024-12-02 07:20:22 +0000

    qlop: improve readability of default duration format
    
    Bug: https://bugs.gentoo.org/945271
    Signed-off-by: Patrick Nagel <mail@patrick-nagel.net>
    Signed-off-by: Fabian Groffen <grobian@gentoo.org>

 qlop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 6 Fabian Groffen gentoo-dev 2024-12-02 07:27:10 UTC
thanks!