From: Zac Medico Date: Mon, 15 Oct 2012 15:02:20 +0000 (-0700) Subject: emerge_main: disable color earlier X-Git-Tag: v2.2.0_alpha139~16 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4eca58411a58fa52cb18f694a899d88e2d93d242;p=portage.git emerge_main: disable color earlier Since commit 2ca487f929962154488999a125a7387eeb44be88, --help has not respected --color=n and related options, since it's been optimized to bypass options and config parsing. Now it's fixed to show without colors in this optimized case (help with colors may be shown in some other cases, like when emerge is called with zero arguments). --- diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py index dc45f8f75..bba10b704 100644 --- a/pym/_emerge/main.py +++ b/pym/_emerge/main.py @@ -1424,6 +1424,10 @@ def emerge_main(args=None): if args is None: args = sys.argv[1:] + # Disable color until we're sure that it should be enabled (after + # EMERGE_DEFAULT_OPTS has been parsed). + portage.output.havecolor = 0 + # optimize --help (no need to load config / EMERGE_DEFAULT_OPTS) if "--help" in args or "-h" in args: emerge_help() @@ -1431,9 +1435,7 @@ def emerge_main(args=None): portage._disable_legacy_globals() portage.dep._internal_warnings = True - # Disable color until we're sure that it should be enabled (after - # EMERGE_DEFAULT_OPTS has been parsed). - portage.output.havecolor = 0 + # This first pass is just for options that need to be known as early as # possible, such as --config-root. They will be parsed again later, # together with EMERGE_DEFAULT_OPTS (which may vary depending on the