diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-01-29 18:47:51 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-01-29 18:47:51 +0000 |
commit | a10c9473d2f46ffa1a98f5a915af09311787a224 (patch) | |
tree | fa2701775e776d48e55ba8d9669ca0a4b70a1ee4 /pym/_emerge/actions.py | |
parent | 942c2f3736f4babf7d0ad9c291a8b4252622f13b (diff) | |
download | portage-a10c9473d2f46ffa1a98f5a915af09311787a224.tar.gz portage-a10c9473d2f46ffa1a98f5a915af09311787a224.tar.bz2 portage-a10c9473d2f46ffa1a98f5a915af09311787a224.zip |
Bug #300388 - Fix terminal handling code to so term codes aren't sent when
TERM=dumb. (trunk r15191)
svn path=/main/branches/2.1.7/; revision=15246
Diffstat (limited to 'pym/_emerge/actions.py')
-rw-r--r-- | pym/_emerge/actions.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index 14854c06f..66a47da8f 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -1291,8 +1291,10 @@ def action_metadata(settings, portdb, myopts, porttrees=None): porttrees = [tree_data.path for tree_data in porttrees_data] - isatty = sys.stdout.isatty() - quiet = not isatty or '--quiet' in myopts + quiet = settings.get('TERM') == 'dumb' or \ + '--quiet' in myopts or \ + not sys.stdout.isatty() + onProgress = None if not quiet: progressBar = portage.output.TermProgressBar() @@ -2213,7 +2215,8 @@ def adjust_config(myopts, settings): portage.output.havecolor = 0 settings["NOCOLOR"] = "true" settings.backup_changes("NOCOLOR") - elif not sys.stdout.isatty() and settings.get("NOCOLOR") != "no": + elif settings.get('TERM') == 'dumb' or \ + not sys.stdout.isatty(): portage.output.havecolor = 0 settings["NOCOLOR"] = "true" settings.backup_changes("NOCOLOR") |