* [gentoo-commits] portage r15191 - in main/trunk: bin pym/_emerge pym/portage
@ 2010-01-11 5:22 Zac Medico (zmedico)
0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2010-01-11 5:22 UTC (permalink / raw
To: gentoo-commits
Author: zmedico
Date: 2010-01-11 05:22:43 +0000 (Mon, 11 Jan 2010)
New Revision: 15191
Modified:
main/trunk/bin/ebuild
main/trunk/bin/emaint
main/trunk/bin/repoman
main/trunk/pym/_emerge/JobStatusDisplay.py
main/trunk/pym/_emerge/actions.py
main/trunk/pym/_emerge/main.py
main/trunk/pym/portage/getbinpkg.py
Log:
Bug #300388 - Fix terminal handling code to so term codes aren't sent when
TERM=dumb.
Modified: main/trunk/bin/ebuild
===================================================================
--- main/trunk/bin/ebuild 2010-01-11 04:44:09 UTC (rev 15190)
+++ main/trunk/bin/ebuild 2010-01-11 05:22:43 UTC (rev 15191)
@@ -88,6 +88,7 @@
if not opts.color == 'y' and \
(opts.color == 'n' or \
portage.settings.get('NOCOLOR') in ('yes', 'true') or \
+ portage.settings.get('TERM') == 'dumb' or \
not sys.stdout.isatty()):
portage.output.nocolor()
portage.settings.unlock()
Modified: main/trunk/bin/emaint
===================================================================
--- main/trunk/bin/emaint 2010-01-11 04:44:09 UTC (rev 15190)
+++ main/trunk/bin/emaint 2010-01-11 05:22:43 UTC (rev 15191)
@@ -536,7 +536,7 @@
status = "Attempting to fix %s"
func = "fix"
- isatty = sys.stdout.isatty()
+ isatty = os.environ.get('TERM') != 'dumb' and sys.stdout.isatty()
for task in tasks:
print(status % task.name())
inst = task()
Modified: main/trunk/bin/repoman
===================================================================
--- main/trunk/bin/repoman 2010-01-11 04:44:09 UTC (rev 15190)
+++ main/trunk/bin/repoman 2010-01-11 05:22:43 UTC (rev 15191)
@@ -96,6 +96,7 @@
repoman_settings.lock()
if repoman_settings.get("NOCOLOR", "").lower() in ("yes", "true") or \
+ repoman_settings.get('TERM') == 'dumb' or \
not sys.stdout.isatty():
nocolor()
Modified: main/trunk/pym/_emerge/JobStatusDisplay.py
===================================================================
--- main/trunk/pym/_emerge/JobStatusDisplay.py 2010-01-11 04:44:09 UTC (rev 15190)
+++ main/trunk/pym/_emerge/JobStatusDisplay.py 2010-01-11 05:22:43 UTC (rev 15191)
@@ -55,7 +55,9 @@
object.__setattr__(self, "_jobs_column_width", width - 32)
self.reset()
- isatty = hasattr(self.out, "isatty") and self.out.isatty()
+ isatty = os.environ.get('TERM') != 'dumb' and \
+ hasattr(self.out, 'isatty') and \
+ self.out.isatty()
object.__setattr__(self, "_isatty", isatty)
if not isatty or not self._init_term():
term_codes = {}
Modified: main/trunk/pym/_emerge/actions.py
===================================================================
--- main/trunk/pym/_emerge/actions.py 2010-01-11 04:44:09 UTC (rev 15190)
+++ main/trunk/pym/_emerge/actions.py 2010-01-11 05:22:43 UTC (rev 15191)
@@ -1467,8 +1467,10 @@
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()
@@ -2389,7 +2391,8 @@
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")
Modified: main/trunk/pym/_emerge/main.py
===================================================================
--- main/trunk/pym/_emerge/main.py 2010-01-11 04:44:09 UTC (rev 15190)
+++ main/trunk/pym/_emerge/main.py 2010-01-11 05:22:43 UTC (rev 15191)
@@ -1324,7 +1324,9 @@
portage.debug.set_trace(True)
if not ("--quiet" in myopts):
- if not sys.stdout.isatty() or ("--nospinner" in myopts):
+ if '--nospinner' in myopts or \
+ settings.get('TERM') == 'dumb' or \
+ not sys.stdout.isatty():
spinner.update = spinner.update_basic
if myaction == 'version':
Modified: main/trunk/pym/portage/getbinpkg.py
===================================================================
--- main/trunk/pym/portage/getbinpkg.py 2010-01-11 04:44:09 UTC (rev 15190)
+++ main/trunk/pym/portage/getbinpkg.py 2010-01-11 05:22:43 UTC (rev 15191)
@@ -638,7 +638,7 @@
self.out.flush()
cache_stats = CacheStats(out)
- have_tty = out.isatty()
+ have_tty = os.environ.get('TERM') != 'dumb' and out.isatty()
if have_tty:
cache_stats.display()
binpkg_filenames = set()
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-01-11 5:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-11 5:22 [gentoo-commits] portage r15191 - in main/trunk: bin pym/_emerge pym/portage Zac Medico (zmedico)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox