summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-09-05 00:56:44 -0700
committerZac Medico <zmedico@gentoo.org>2010-09-05 00:56:44 -0700
commit702204887eeec7b15a3536d5fbe22fe3d5c498a5 (patch)
tree67a74d18d1046dc8e500a0c5498b4485b752ff20
parentb703d3088f01060309479979a226d88b0e627931 (diff)
downloadportage-702204887eeec7b15a3536d5fbe22fe3d5c498a5.tar.gz
portage-702204887eeec7b15a3536d5fbe22fe3d5c498a5.tar.bz2
portage-702204887eeec7b15a3536d5fbe22fe3d5c498a5.zip
Make EbuildPhase._elog() use the NOCOLOR variable from self.settings,
so presence of color in the log file is consistent.
-rw-r--r--pym/_emerge/EbuildPhase.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/pym/_emerge/EbuildPhase.py b/pym/_emerge/EbuildPhase.py
index a5d617f65..fd010c059 100644
--- a/pym/_emerge/EbuildPhase.py
+++ b/pym/_emerge/EbuildPhase.py
@@ -219,8 +219,14 @@ class EbuildPhase(CompositeTask):
out = StringIO()
phase = self.phase
elog_func = getattr(elog_messages, elog_funcname)
- for line in lines:
- elog_func(line, phase=phase, key=self.settings.mycpv, out=out)
+ global_havecolor = portage.output.havecolor
+ try:
+ portage.output.havecolor = \
+ self.settings.get('NOCOLOR', 'false').lower() in ('no', 'false')
+ for line in lines:
+ elog_func(line, phase=phase, key=self.settings.mycpv, out=out)
+ finally:
+ portage.output.havecolor = global_havecolor
msg = _unicode_decode(out.getvalue(),
encoding=_encodings['content'], errors='replace')
if msg: