summaryrefslogtreecommitdiffstats
path: root/bin/ebuild
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-10-09 20:16:45 +0000
committerZac Medico <zmedico@gentoo.org>2009-10-09 20:16:45 +0000
commit5dd33e5ad16526b1dae7923dbdffe39b1afb65ef (patch)
tree49d6a16f97a20601dee290ab5a13151130b8a82c /bin/ebuild
parent32f6f79fb99b6ac92d8e9b106a909ea3e99ccdd1 (diff)
downloadportage-5dd33e5ad16526b1dae7923dbdffe39b1afb65ef.tar.gz
portage-5dd33e5ad16526b1dae7923dbdffe39b1afb65ef.tar.bz2
portage-5dd33e5ad16526b1dae7923dbdffe39b1afb65ef.zip
Add a --color < y | n > option so that color output can be forced. This is
going to be used by emerge to force color fetch output when appropriate. svn path=/main/trunk/; revision=14529
Diffstat (limited to 'bin/ebuild')
-rwxr-xr-xbin/ebuild10
1 files changed, 9 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)