summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-02-18 04:05:16 -0800
committerZac Medico <zmedico@gentoo.org>2011-02-18 04:05:16 -0800
commitb65b63b49c77e8b55adc6aec2ec2c7ea1a7afff8 (patch)
tree5a86286f16521760dfaad3970fe42c52e9b406ba
parente7ca7fc07c00584259b6a303c1cdca87e91dc70e (diff)
downloadportage-b65b63b49c77e8b55adc6aec2ec2c7ea1a7afff8.tar.gz
portage-b65b63b49c77e8b55adc6aec2ec2c7ea1a7afff8.tar.bz2
portage-b65b63b49c77e8b55adc6aec2ec2c7ea1a7afff8.zip
BinpkgVerifier: disable color in background mode
-rw-r--r--pym/_emerge/BinpkgVerifier.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/pym/_emerge/BinpkgVerifier.py b/pym/_emerge/BinpkgVerifier.py
index 6c71977c6..379c862af 100644
--- a/pym/_emerge/BinpkgVerifier.py
+++ b/pym/_emerge/BinpkgVerifier.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from _emerge.AsynchronousTask import AsynchronousTask
@@ -26,11 +26,14 @@ class BinpkgVerifier(AsynchronousTask):
rval = os.EX_OK
stdout_orig = sys.stdout
stderr_orig = sys.stderr
+ global_havecolor = portage.output.havecolor
out = portage.StringIO()
file_exists = True
try:
sys.stdout = out
sys.stderr = out
+ if portage.output.havecolor:
+ portage.output.havecolor = not self.background
try:
bintree.digestCheck(pkg)
except portage.exception.FileNotFound:
@@ -61,6 +64,7 @@ class BinpkgVerifier(AsynchronousTask):
finally:
sys.stdout = stdout_orig
sys.stderr = stderr_orig
+ portage.output.havecolor = global_havecolor
msg = _unicode_decode(out.getvalue(),
encoding=_encodings['content'], errors='replace')