egencache,emirrordist: export NOCOLOR if no tty
authorZac Medico <zmedico@gentoo.org>
Mon, 1 Apr 2013 16:26:05 +0000 (09:26 -0700)
committerZac Medico <zmedico@gentoo.org>
Mon, 1 Apr 2013 16:26:05 +0000 (09:26 -0700)
bin/egencache
pym/portage/_emirrordist/main.py

index cbc4b28ad265e27d11b4ae97c261865932e2e95c..59d5c3bd7a48f63f5dc843b5b2c59a6af2668406 100755 (executable)
@@ -845,17 +845,18 @@ class GenChangeLogs(object):
 
 def egencache_main(args):
 
+       # The calling environment is ignored, so the program is
+       # completely controlled by commandline arguments.
+       env = {}
+
        if not sys.stdout.isatty():
                portage.output.nocolor()
+               env['NOCOLOR'] = 'true'
 
        parser, options, atoms = parse_args(args)
 
        config_root = options.config_root
 
-       # The calling environment is ignored, so the program is
-       # completely controlled by commandline arguments.
-       env = {}
-
        if options.repo is None:
                env['PORTDIR_OVERLAY'] = ''
        elif options.portdir_overlay:
index b94bff00bde5e3eab6824a6da1427331e9a2208c..e19f4aa7b55fc82bc7010ec122f85d6e76953659 100644 (file)
@@ -224,8 +224,13 @@ def parse_args(args):
 
 def emirrordist_main(args):
 
+       # The calling environment is ignored, so the program is
+       # completely controlled by commandline arguments.
+       env = {}
+
        if not sys.stdout.isatty():
                portage.output.nocolor()
+               env['NOCOLOR'] = 'true'
 
        parser, options, args = parse_args(args)
 
@@ -235,10 +240,6 @@ def emirrordist_main(args):
 
        config_root = options.config_root
 
-       # The calling environment is ignored, so the program is
-       # completely controlled by commandline arguments.
-       env = {}
-
        if options.repo is None:
                env['PORTDIR_OVERLAY'] = ''
        elif options.portdir_overlay: