Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 125120 - portage color remapping
Summary: portage color remapping
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL: http://dev.gentoo.org/~solar/portage_...
Whiteboard:
Keywords: Inclusion, InVCS
: 63517 (view as bug list)
Depends on:
Blocks: 115839 120576
  Show dependency tree
 
Reported: 2006-03-05 12:30 UTC by solar (RETIRED)
Modified: 2006-09-16 16:02 UTC (History)
3 users (show)

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


Attachments
portage-color-remap.patch (portage-color-remap.patch,627 bytes, patch)
2006-03-05 12:31 UTC, solar (RETIRED)
Details | Diff
Example: /etc/portage/color.map (color.map,467 bytes, text/plain)
2006-03-05 12:31 UTC, solar (RETIRED)
Details
colormap.c (colormap.c,1.86 KB, patch)
2006-03-05 17:03 UTC, solar (RETIRED)
Details | Diff
color_map.patch (color_map.patch,2.64 KB, patch)
2006-04-04 03:09 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description solar (RETIRED) gentoo-dev 2006-03-05 12:30:54 UTC
The default color scheme provided by portage with the new USE= flag output is 
rather unreadable on a white background. Some usersmay prefer a white 
background. Or may to simply customize the portage on the local box. 
(probably bigest use)

This patch offers a way to let the end user remap colors used by portage and 
friends that import portage/output

It adds one global call on initial import but that is minimal and never seems to 
get sourced in more than one time no matter how many times the portage is 
imported.

Tested with:
 strace -eopen -f -o woof -v python -c 'import portage; import portage'
 grep \"/usr/lib/portage/pym/output.py\" woof
Comment 1 solar (RETIRED) gentoo-dev 2006-03-05 12:31:16 UTC
Created attachment 81441 [details, diff]
portage-color-remap.patch
Comment 2 solar (RETIRED) gentoo-dev 2006-03-05 12:31:54 UTC
Created attachment 81442 [details]
Example: /etc/portage/color.map
Comment 3 Zac Medico gentoo-dev 2006-03-05 13:08:55 UTC
*** Bug 63517 has been marked as a duplicate of this bug. ***
Comment 4 solar (RETIRED) gentoo-dev 2006-03-05 13:27:14 UTC
Thanks Zac. I never spotted bug #63517 before.
Comment 5 Zac Medico gentoo-dev 2006-03-05 14:10:49 UTC
What I'd really like to see is a color mapping service that can be used be all console apps (regardless of language, bash included).  I've described the idea in bug 120576#c5.
Comment 6 solar (RETIRED) gentoo-dev 2006-03-05 17:03:07 UTC
Created attachment 81472 [details, diff]
colormap.c

This should meet your requirements.
Comment 7 solar (RETIRED) gentoo-dev 2006-04-02 07:57:49 UTC
Zac, ping.
Comment 8 Zac Medico gentoo-dev 2006-04-02 18:38:57 UTC
I'm working on something similar to portage-color-remap.patch but the config file will contain only color names and/or rgb values rather than the actual ansi color codes.  The codes are an implementation detail that, imo, should be separate from the user's color map choices.
Comment 9 Zac Medico gentoo-dev 2006-04-04 03:09:40 UTC
Created attachment 83869 [details, diff]
color_map.patch

This patch is compatible with portage-color-remap.patch and adds the ability to assign colors symbolically.  For example, red can be mapped to 31;01m via 'fatal error', like this:

'fatal error'=31;01m
red='fatal error'
Comment 10 Zac Medico gentoo-dev 2006-04-04 14:18:07 UTC
This is in svn r3072.
Comment 11 Zac Medico gentoo-dev 2006-04-17 00:55:20 UTC
Released in 2.1_pre8.
Comment 12 Jan Schnackenberg 2006-06-12 03:41:28 UTC
Very nice feature. I even got it to work after squinting at the patch for about 10 minutes.

Now my question. I didn't find any documentation about this. Is there none? Or is it just so well hidden, that I didn't find it?

I looked at "man emerge" and "man portage" and at some of the portage-manuals on the website.
Comment 13 solar (RETIRED) gentoo-dev 2006-06-12 19:49:04 UTC
(In reply to comment #12)
> Very nice feature. I even got it to work after squinting at the patch for about
> 10 minutes.
> 
> Now my question. I didn't find any documentation about this. Is there none? Or
> is it just so well hidden, that I didn't find it?

Bad habit but docs tend to be an after thought. 
User contributed documentation is welcome.
Comment 14 Jakub Moc (RETIRED) gentoo-dev 2006-09-15 10:11:23 UTC
*** Bug 147704 has been marked as a duplicate of this bug. ***
Comment 15 David Grant 2006-09-15 11:13:45 UTC
Great idea, but I think in addition to this you could also just make the default portage colours work for both black and white backgrounds.
Comment 16 solar (RETIRED) gentoo-dev 2006-09-16 00:16:17 UTC
This bug is in FIXED state. With color remapping you can set anything you 
want. WHITE/BLACK/PINK/CYAN/OTHER... So... What are you commenting on David?
Comment 17 David Grant 2006-09-16 16:02:55 UTC
You're right, my bug really wasn't a duplicate of this one. I should re-specify my bug.