Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 251032 - layman -L: better use of screen real estate for source URLs
Summary: layman -L: better use of screen real estate for source URLs
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gunnar Wrobel (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-15 14:55 UTC by Martin von Gagern
Modified: 2008-12-28 22:59 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
First version of proposed patch (bug251032a.patch,1.26 KB, patch)
2008-12-15 14:56 UTC, Martin von Gagern
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin von Gagern 2008-12-15 14:55:49 UTC
Currently a call to "layman -L" will list a lot of repositories, each with its source. The sources however are mostly truncated to common parts and thus provide little valuable information.

I've written a patch to overlay.py which addresses this by
1. dropping the common string "source: " which should be clear from context
   and thus is only a waste of space.
2. querying actual terminal window width to use longer lines where available.
   Here the COLUMNS environment variable takes precedence over the value
   returned via the TIOCGWINSZ ioctl, with 80 as the default fallback.
3. Abbreviate the common "overlays.gentoo.org" to "o.g.o" in cases that would
   otherwise be truncated.

I'll attach the patch and suggest it for inclusion. The idea for the TIOCGWINSZ call comes from bzr, but I adjusted the precedence, so users have a final word. YOu might of course decide to move this terminal handling code away from the overlays module and closer towards the user interface code. I leave that to you for now, unless you indicate a place where you would like to have it included.
Comment 1 Martin von Gagern 2008-12-15 14:56:48 UTC
Created attachment 175343 [details, diff]
First version of proposed patch
Comment 2 Gunnar Wrobel (RETIRED) gentoo-dev 2008-12-28 22:59:26 UTC
Thanks for the patch! Included in layman-1.2.2.