From 702204887eeec7b15a3536d5fbe22fe3d5c498a5 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 5 Sep 2010 00:56:44 -0700 Subject: [PATCH] Make EbuildPhase._elog() use the NOCOLOR variable from self.settings, so presence of color in the log file is consistent. --- pym/_emerge/EbuildPhase.py | 10 ++++++++-- 1 file 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: -- 2.26.2