Allow /etc/portage/color.map to control colors associated with einfo, ewarn, etc...
authorZac Medico <zmedico@gentoo.org>
Mon, 26 Jun 2006 05:39:35 +0000 (05:39 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 26 Jun 2006 05:39:35 +0000 (05:39 -0000)
svn path=/main/trunk/; revision=3665

bin/isolated-functions.sh
pym/portage.py

index 94ff1c983810b7f9686c4d349b6e91f5a68eb8d6..d5d9b572da7b3f29f7636e4aa35bdc198f2cba64 100644 (file)
@@ -200,11 +200,11 @@ set_colors() {
        ENDCOL=$'\e[A\e['${COLS}'C'    # Now, ${ENDCOL} will move us to the end of the
                                       # column;  irregardless of character width
 
-       GOOD=$'\e[32;01m'
-       WARN=$'\e[33;01m'
-       BAD=$'\e[31;01m'
-       HILITE=$'\e[36;01m'
-       BRACKET=$'\e[34;01m'
+       [ -z "${GOOD}"    ] && GOOD=$'\e[32;01m'
+       [ -z "${WARN}"    ] && WARN=$'\e[33;01m'
+       [ -z "${BAD}"     ] && BAD=$'\e[31;01m'
+       [ -z "${HILITE}"  ] && HILITE=$'\e[36;01m'
+       [ -z "${BRACKET}" ] && BRACKET=$'\e[34;01m'
        NORMAL=$'\e[0m'
 }
 
index 7f33a2a5bbf4cf676ab5983df9da516281d1ff1b..d1b8a7354580188f6329a58e2b448b539e541220 100644 (file)
@@ -2523,6 +2523,10 @@ def doebuild_environment(myebuild, mydo, myroot, mysettings, debug, use_cache, m
                myso=os.uname()[2]
                mysettings["KVERS"]=myso[1]
 
+       # Allow color.map to control colors associated with einfo, ewarn, etc...
+       for c in ("GOOD", "WARN", "BAD", "HILITE", "BRACKET"):
+               mysettings[c] = output.codes[c]
+
 def prepare_build_dirs(myroot, mysettings, cleanup):
 
        clean_dirs = [mysettings["HOME"]]