Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 475032 - EINFO_COLOR used inconsistently between functions.sh and libeinfo.so
Summary: EINFO_COLOR used inconsistently between functions.sh and libeinfo.so
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-27 21:40 UTC by Jacob Floyd
Modified: 2016-09-20 18:45 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jacob Floyd 2013-06-27 21:40:26 UTC
I described in my blog post[1] how I changed the colors of rc-status, rc-config, rc-service and other OpenRC tools.

The environment variable EINFO_COLOR affects OpenRC's color output. EINFO_COLOR=no disables color for tools that use either functions.sh[2] or libeinfo.so[3].

libeinfo.so also supports specifying specific colors in EINFO_COLOR instead of a boolean value[4].
A valid EINFO_COLORS could be (this example makes OpenRC use a solarized color pallette):
    EINFO_COLOR="good=2;0:bad=1;0:warn=1;1:hilite=7;1:"

However, functions.sh does not support specifying colors in this manner. Please support it, or provide a consistent way to change the colors of both libeinfo.so and functions.sh

[1] http://cognifloyd.blogspot.com/2013/06/changing-openrc-colors-to-use-solarized.html
[2] http://bit.ly/11LTdMC (functions.sh.in line 99)
[3] http://bit.ly/17m0raY (libeinfo.c line 366)
[4] http://bit.ly/17m0eVf (libeinfo.c line 451)

Reproducible: Always

Steps to Reproduce:
1. Set EINFO_COLOR to specify specific colors, like:
export EINFO_COLOR="good=2;0:bad=1;0:warn=1;1:hilite=7;1:"
2. Run revdep-rebuild
Actual Results:  
# revdep-rebuild
/etc/init.d/functions.sh: line 33: 0:bad=1: command not found
/etc/init.d/functions.sh: line 33: 0:warn=1: command not found
/etc/init.d/functions.sh: line 33: 1:hilite=7: command not found
/etc/init.d/functions.sh: line 33: 1:: command not found
 * Configuring search environment for revdep-rebuild
[snip]

Expected Results:  
Accurately colorized output like apps that use /usr/lib/libeinfo.so
Comment 2 William Hubbs gentoo-dev 2016-09-20 18:45:23 UTC
I'm not sure why this wasn't closed; it looks like it was fixed in
OpenRC-0.13.2.