summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/ebuild10
-rw-r--r--man/ebuild.15
2 files changed, 14 insertions, 1 deletions
diff --git a/bin/ebuild b/bin/ebuild
index bcb55555c..dc3f448c4 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -40,6 +40,8 @@ force_help = "When used together with the digest or manifest " + \
"that do not already exist in ${DISTDIR} will be automatically fetched."
parser.add_option("--force", help=force_help, action="store_true", dest="force")
+parser.add_option("--color", help="enable or disable color output",
+ type="choice", choices=("y", "n"))
parser.add_option("--debug", help="show debug output",
action="store_true", dest="debug")
parser.add_option("--ignore-default-opts",
@@ -83,8 +85,14 @@ if debug and "python-trace" in portage.features:
import portage.debug
portage.debug.set_trace(True)
-if portage.settings["NOCOLOR"] in ("yes","true") or not sys.stdout.isatty():
+if not opts.color == 'y' and \
+ (opts.color == 'n' or \
+ portage.settings.get('NOCOLOR') in ('yes', 'true') or \
+ not sys.stdout.isatty()):
portage.output.nocolor()
+ portage.settings.unlock()
+ portage.settings['NOCOLOR'] = 'true'
+ portage.settings.lock()
ebuild = pargs.pop(0)
diff --git a/man/ebuild.1 b/man/ebuild.1
index 6c134c7cb..87fd63b79 100644
--- a/man/ebuild.1
+++ b/man/ebuild.1
@@ -185,6 +185,11 @@ information is not incorporated into the RPM.
Run bash with the \-x option, causing it to output verbose debugging
information to stdout.
.TP
+.BR "\-\-color < y | n >"
+Enable or disable color output. This option will override \fINOCOLOR\fR
+(see \fBmake.conf\fR(5)) and may also be used to force color output when stdout
+is not a tty (by default, color is disabled unless stdout is a tty).
+.TP
.BR "\-\-force"
When used together with the digest or manifest command,
this option forces regeneration of