From: Zac Medico Date: Mon, 1 Apr 2013 16:26:05 +0000 (-0700) Subject: egencache,emirrordist: export NOCOLOR if no tty X-Git-Tag: v2.2.0_alpha171~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0ec9ef23e59646583487be53afb53cceb50ab581;p=portage.git egencache,emirrordist: export NOCOLOR if no tty --- diff --git a/bin/egencache b/bin/egencache index cbc4b28ad..59d5c3bd7 100755 --- a/bin/egencache +++ b/bin/egencache @@ -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: diff --git a/pym/portage/_emirrordist/main.py b/pym/portage/_emirrordist/main.py index b94bff00b..e19f4aa7b 100644 --- a/pym/portage/_emirrordist/main.py +++ b/pym/portage/_emirrordist/main.py @@ -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: