egencache,emirrordist: disable color if no tty
authorZac Medico <zmedico@gentoo.org>
Mon, 1 Apr 2013 15:33:55 +0000 (08:33 -0700)
committerZac Medico <zmedico@gentoo.org>
Mon, 1 Apr 2013 15:33:55 +0000 (08:33 -0700)
bin/egencache
pym/portage/_emirrordist/main.py

index 797105c43406b93392bdce4b81ed1782367b3f54..cbc4b28ad265e27d11b4ae97c261865932e2e95c 100755 (executable)
@@ -844,6 +844,10 @@ class GenChangeLogs(object):
                                self.generate_changelog(cp)
 
 def egencache_main(args):
+
+       if not sys.stdout.isatty():
+               portage.output.nocolor()
+
        parser, options, atoms = parse_args(args)
 
        config_root = options.config_root
index da9f3f327a4f00a0864809827e9b8c7a1e7e8ca2..b94bff00bde5e3eab6824a6da1427331e9a2208c 100644 (file)
@@ -224,6 +224,9 @@ def parse_args(args):
 
 def emirrordist_main(args):
 
+       if not sys.stdout.isatty():
+               portage.output.nocolor()
+
        parser, options, args = parse_args(args)
 
        if options.version: