summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-03-19 06:14:31 +0000
committerZac Medico <zmedico@gentoo.org>2006-03-19 06:14:31 +0000
commit33fb63036aa9a930f8aba56c791ef56296475922 (patch)
tree8fa485f1e6b487305dfd4eb746a2f3b5f6d874af
parent0ddfa4466b6e88749493eda2481da3bd5e798bdc (diff)
downloadportage-33fb63036aa9a930f8aba56c791ef56296475922.tar.gz
portage-33fb63036aa9a930f8aba56c791ef56296475922.tar.bz2
portage-33fb63036aa9a930f8aba56c791ef56296475922.zip
Add NOCOLOR support to ebuild.sh and make emerge automatically add NOCOLOR to portage.settings when --nocolor is specified. See bug #126756.
svn path=/main/trunk/; revision=2952
-rwxr-xr-xbin/ebuild.sh12
-rwxr-xr-xbin/emerge8
2 files changed, 17 insertions, 3 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 40c788a88..791625c6d 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -51,8 +51,16 @@ export PATH="/sbin:/usr/sbin:/usr/lib/portage/bin:/bin:/usr/bin:${ROOTPATH}"
[ ! -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"
diff --git a/bin/emerge b/bin/emerge
index b1e103c62..a3c256ca6 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -408,8 +408,14 @@ if ("--resume" in myopts):
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):