From: Zac Medico Date: Sun, 5 Sep 2010 07:56:44 +0000 (-0700) Subject: Make EbuildPhase._elog() use the NOCOLOR variable from self.settings, X-Git-Tag: v2.2_rc76~47 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=702204887eeec7b15a3536d5fbe22fe3d5c498a5;p=portage.git Make EbuildPhase._elog() use the NOCOLOR variable from self.settings, so presence of color in the log file is consistent. --- 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: