Index: bin/emerge =================================================================== --- bin/emerge (revision 2951) +++ bin/emerge (working copy) @@ -408,8 +408,14 @@ myopts.remove("--tree") # Set color output -if ("--nocolor" in myopts) and (sys.stdout.isatty()): +if "--nocolor" in myopts or \ +portage.settings["NOCOLOR"] in ("yes","true"): nocolor() + if "NOCOLOR" not in portage.settings: + portage.settings.unlock() + portage.settings["NOCOLOR"] = "true" + portage.settings.backup_changes("NOCOLOR") + portage.settings.lock() if not ("--quiet" in myopts): if not sys.stdout.isatty() or ("--nospinner" in myopts): Index: bin/ebuild.sh =================================================================== --- bin/ebuild.sh (revision 2951) +++ bin/ebuild.sh (working copy) @@ -51,9 +51,17 @@ [ ! -z "$PREROOTPATH" ] && export PATH="${PREROOTPATH%%:}:$PATH" source /usr/lib/portage/bin/isolated-functions.sh &>/dev/null -# TODO: make this conditional on config settings, fix any remaining stuff -set_colors +case "${NOCOLOR:-false}" in + yes|true) + unset_colors + ;; + no|false) + set_colors + ;; +esac + + # the sandbox is disabled by default except when overridden in the relevant stages export SANDBOX_ON="0"