When in background mode, set NOCOLOR=true in order to prevent color
authorZac Medico <zmedico@gentoo.org>
Sat, 14 Aug 2010 17:21:45 +0000 (10:21 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 14 Aug 2010 17:21:45 +0000 (10:21 -0700)
codes from showing up in logs, since we're not displaying to a terminal
anyway. Thanks to Brian Harring for the suggestion.

pym/_emerge/AbstractEbuildProcess.py

index 0dec6503659e72e34211077753a4465f137b6947..de120e8adf4d909730615dacf2ea978e7069ceda 100644 (file)
@@ -33,6 +33,11 @@ class AbstractEbuildProcess(SpawnProcess):
 
        def _start(self):
 
+               if self.background:
+                       # Automatically prevent color codes from showing up in logs,
+                       # since we're not displaying to a terminal anyway.
+                       self.settings['NOCOLOR'] = 'true'
+
                if self.phase not in self._phases_without_builddir:
                        self.settings['PORTAGE_IPC_DAEMON'] = "1"
                        self._exit_command = ExitCommand()