summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-06-26 18:51:39 +0000
committerZac Medico <zmedico@gentoo.org>2006-06-26 18:51:39 +0000
commit2d9d2fac75980398994c8a806f33cc26dde504cb (patch)
tree1ac86ff1036312bd3c8e816292a58f3d63e05c84
parent3f1530507147d009b65abecce6e908793a149a31 (diff)
downloadportage-2d9d2fac75980398994c8a806f33cc26dde504cb.tar.gz
portage-2d9d2fac75980398994c8a806f33cc26dde504cb.tar.bz2
portage-2d9d2fac75980398994c8a806f33cc26dde504cb.zip
Turn off color automatically when stdout is a pipe, but allow the behavior to be overridden via the NOCOLOR environment variable.
svn path=/main/trunk/; revision=3667
-rwxr-xr-xbin/emerge3
1 files changed, 3 insertions, 0 deletions
diff --git a/bin/emerge b/bin/emerge
index d0d1a3fdc..0739986f5 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -3435,6 +3435,9 @@ def emerge_main():
if settings.get("NOCOLOR","") in ("yes","true"):
nocolor()
+ elif (not sys.stdout.isatty()) and \
+ settings.get("NOCOLOR","") not in ("no","false"):
+ nocolor()
tmpcmdline = sys.argv[1:]
if "--ignore-default-opts" not in tmpcmdline: