From 0ec9ef23e59646583487be53afb53cceb50ab581 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 1 Apr 2013 09:26:05 -0700 Subject: [PATCH] egencache,emirrordist: export NOCOLOR if no tty --- bin/egencache | 9 +++++---- pym/portage/_emirrordist/main.py | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) 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: -- 2.26.2