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

Bug 183861

Summary: Colors support improvements
Product: Portage Development Reporter: Arfrever Frehtes Taifersar Arahesis (RETIRED) <arfrever>
Component: Core - Interface (emerge)Assignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: enhancement Keywords: InVCS
Priority: High    
Version: 2.1   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 181949    
Attachments: Patch to pym/portage/output.py
Patch

Description Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2007-07-01 17:50:14 UTC
Colorizing should support variables with multiples values. In terminal I can run:
echo -e "\e[4;34;46mTEXT\e[0m"

But I can't have in color.map:
PKG_MERGE_ARG="underline teal"
(I tried also PKG_MERGE_ARG="underline,teal", PKG_MERGE_ARG="underline;teal" etc.)
Alone PKG_MERGE_ARG="underline" or PKG_MERGE_ARG="teal" work correctly.

Also Portage should support colorizing of background. In terminal I can run:
echo -e "\e[41mTEXT\e[0m"
But there is no possibility to set custom background in a variable in color.map.

(Also, what is the purpose of g_attr and color(fg, bg, attr)?)
Comment 1 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2007-07-02 15:39:38 UTC
I've just discovered that PKG_MERGE_ARG and PKG_NOMERGE_ARG are used for system packages when emerge is invoked with world as an argument :) .
Comment 2 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2007-07-02 16:52:45 UTC
I have some suggestions to make system of colors more consistent:
1.
PKG_MERGE_SYSTEM / PKG_NOMERGE_SYSTEM should be always used for system packages not given as command line arguments.
PKG_MERGE_WORLD / PKG_NOMERGE_WORLD should be always used for world packages not given as command line arguments.
PKG_MERGE_ARG_SYSTEM / PKG_NOMERGE_ARG_SYSTEM should be created and always used for system packages given as command line arguments.
PKG_MERGE_ARG_WORLD / PKG_NOMERGE_ARG_WORLD should be created and always used for world packages given as command line arguments.
2. Default values:
PKG_MERGE_ARG="darkgreen red"
PKG_MERGE_SYSTEM="bg_green"
PKG_MERGE_ARG_SYSTEM="bg_green red"
PKG_MERGE_ARG_WORLD="green red"

PKG_NOMERGE_ARG="darkblue red"
PKG_NOMERGE_SYSTEM="bg_blue"
PKG_NOMERGE_ARG_SYSTEM="bg_blue red"
PKG_NOMERGE_ARG_WORLD="blue red"

So background color would mean system package and red foreground color would mean package given as command line argument. It would be easier to understand and remember.
Comment 3 Zac Medico gentoo-dev 2007-07-02 17:34:41 UTC
If you want to enable some background colors in your local config then that's fine.  If we do it by default then I'm quite sure that it will upset lots of people.  Lots of people are very sensitive to user interface changes like that.  Personally, I don't want any background colors on my terminal. :)
Comment 4 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2007-07-02 17:44:00 UTC
(In reply to comment #3)
OK. They were also some stupid typos in that suggestion (because I originally thought about "underline" instead of "red"), so here is the new one:
Default values:
PKG_MERGE_ARG="darkgreen" // No change
PKG_MERGE_SYSTEM="green" // No change
PKG_MERGE_ARG_SYSTEM="green"
PKG_MERGE_ARG_WORLD="green"

PKG_NOMERGE_ARG="darkblue" // No change
PKG_NOMERGE_SYSTEM="blue" // No change
PKG_NOMERGE_ARG_SYSTEM="blue"
PKG_NOMERGE_ARG_WORLD="blue"
Comment 5 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2007-07-03 21:01:37 UTC
Created attachment 123826 [details, diff]
Patch to pym/portage/output.py

This patch only fixes issues described in comment #0 and adds default values for new variables. These new variables still aren't used.
Comment 6 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2007-07-03 21:03:33 UTC
Changing of "raise" to "print" is intentional.
Comment 7 Zac Medico gentoo-dev 2007-07-05 00:58:47 UTC
Thanks again, this is all in svn now.
Comment 8 Zac Medico gentoo-dev 2007-07-06 01:43:03 UTC
I'm not sure if people are really going to use the *ARG* color classes.  Maybe we should just remove them to simplify things.
Comment 9 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2007-07-06 15:35:02 UTC
Created attachment 124064 [details, diff]
Patch

pym/portage/output.py:
   -I think that background colors should have names similar to corresponding
   foreground colors.
   -codes["white"] is set earlier to real white color.
   -pym/output.py@3029 says that "fuscia" is spelled wrong and now it isn't
   used anywhere.

pym/emerge/__init__.py:
   -I think that pkg_system should be checked before pkg_world. Otherwise
   PKG_{,NO}MERGE_SYSTEM won't be used in many cases.

man/color.map.5:
   -I think that hexadecimal values shouldn't be used in this manual, because
   only limited set of such values is available. People can still check them
   in pym/portage/output.py.
   -New section: "LIST OF VALID ATTRIBUTES".
Comment 10 Zac Medico gentoo-dev 2007-07-08 21:41:08 UTC
(In reply to comment #9)
> Created an attachment (id=124064) [edit]
> Patch

Thanks again, that's in svn r7184.  This has been released in 2.1.3_rc7.