Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r15246 - in main/branches/2.1.7: bin pym/_emerge pym/portage
Date: Fri, 29 Jan 2010 18:47:54
Message-Id: E1Navsl-0006da-Kq@stork.gentoo.org
1 Author: zmedico
2 Date: 2010-01-29 18:47:51 +0000 (Fri, 29 Jan 2010)
3 New Revision: 15246
4
5 Modified:
6 main/branches/2.1.7/bin/ebuild
7 main/branches/2.1.7/bin/emaint
8 main/branches/2.1.7/bin/repoman
9 main/branches/2.1.7/pym/_emerge/JobStatusDisplay.py
10 main/branches/2.1.7/pym/_emerge/actions.py
11 main/branches/2.1.7/pym/_emerge/main.py
12 main/branches/2.1.7/pym/portage/getbinpkg.py
13 Log:
14 Bug #300388 - Fix terminal handling code to so term codes aren't sent when
15 TERM=dumb. (trunk r15191)
16
17 Modified: main/branches/2.1.7/bin/ebuild
18 ===================================================================
19 --- main/branches/2.1.7/bin/ebuild 2010-01-29 18:47:30 UTC (rev 15245)
20 +++ main/branches/2.1.7/bin/ebuild 2010-01-29 18:47:51 UTC (rev 15246)
21 @@ -88,6 +88,7 @@
22 if not opts.color == 'y' and \
23 (opts.color == 'n' or \
24 portage.settings.get('NOCOLOR') in ('yes', 'true') or \
25 + portage.settings.get('TERM') == 'dumb' or \
26 not sys.stdout.isatty()):
27 portage.output.nocolor()
28 portage.settings.unlock()
29
30 Modified: main/branches/2.1.7/bin/emaint
31 ===================================================================
32 --- main/branches/2.1.7/bin/emaint 2010-01-29 18:47:30 UTC (rev 15245)
33 +++ main/branches/2.1.7/bin/emaint 2010-01-29 18:47:51 UTC (rev 15246)
34 @@ -536,7 +536,7 @@
35 status = "Attempting to fix %s"
36 func = "fix"
37
38 - isatty = sys.stdout.isatty()
39 + isatty = os.environ.get('TERM') != 'dumb' and sys.stdout.isatty()
40 for task in tasks:
41 print(status % task.name())
42 inst = task()
43
44 Modified: main/branches/2.1.7/bin/repoman
45 ===================================================================
46 --- main/branches/2.1.7/bin/repoman 2010-01-29 18:47:30 UTC (rev 15245)
47 +++ main/branches/2.1.7/bin/repoman 2010-01-29 18:47:51 UTC (rev 15246)
48 @@ -96,6 +96,7 @@
49 repoman_settings.lock()
50
51 if repoman_settings.get("NOCOLOR", "").lower() in ("yes", "true") or \
52 + repoman_settings.get('TERM') == 'dumb' or \
53 not sys.stdout.isatty():
54 nocolor()
55
56
57 Modified: main/branches/2.1.7/pym/_emerge/JobStatusDisplay.py
58 ===================================================================
59 --- main/branches/2.1.7/pym/_emerge/JobStatusDisplay.py 2010-01-29 18:47:30 UTC (rev 15245)
60 +++ main/branches/2.1.7/pym/_emerge/JobStatusDisplay.py 2010-01-29 18:47:51 UTC (rev 15246)
61 @@ -55,7 +55,9 @@
62 object.__setattr__(self, "_jobs_column_width", width - 32)
63 self.reset()
64
65 - isatty = hasattr(self.out, "isatty") and self.out.isatty()
66 + isatty = os.environ.get('TERM') != 'dumb' and \
67 + hasattr(self.out, 'isatty') and \
68 + self.out.isatty()
69 object.__setattr__(self, "_isatty", isatty)
70 if not isatty or not self._init_term():
71 term_codes = {}
72
73 Modified: main/branches/2.1.7/pym/_emerge/actions.py
74 ===================================================================
75 --- main/branches/2.1.7/pym/_emerge/actions.py 2010-01-29 18:47:30 UTC (rev 15245)
76 +++ main/branches/2.1.7/pym/_emerge/actions.py 2010-01-29 18:47:51 UTC (rev 15246)
77 @@ -1291,8 +1291,10 @@
78
79 porttrees = [tree_data.path for tree_data in porttrees_data]
80
81 - isatty = sys.stdout.isatty()
82 - quiet = not isatty or '--quiet' in myopts
83 + quiet = settings.get('TERM') == 'dumb' or \
84 + '--quiet' in myopts or \
85 + not sys.stdout.isatty()
86 +
87 onProgress = None
88 if not quiet:
89 progressBar = portage.output.TermProgressBar()
90 @@ -2213,7 +2215,8 @@
91 portage.output.havecolor = 0
92 settings["NOCOLOR"] = "true"
93 settings.backup_changes("NOCOLOR")
94 - elif not sys.stdout.isatty() and settings.get("NOCOLOR") != "no":
95 + elif settings.get('TERM') == 'dumb' or \
96 + not sys.stdout.isatty():
97 portage.output.havecolor = 0
98 settings["NOCOLOR"] = "true"
99 settings.backup_changes("NOCOLOR")
100
101 Modified: main/branches/2.1.7/pym/_emerge/main.py
102 ===================================================================
103 --- main/branches/2.1.7/pym/_emerge/main.py 2010-01-29 18:47:30 UTC (rev 15245)
104 +++ main/branches/2.1.7/pym/_emerge/main.py 2010-01-29 18:47:51 UTC (rev 15246)
105 @@ -1179,7 +1179,9 @@
106 portage.debug.set_trace(True)
107
108 if not ("--quiet" in myopts):
109 - if not sys.stdout.isatty() or ("--nospinner" in myopts):
110 + if '--nospinner' in myopts or \
111 + settings.get('TERM') == 'dumb' or \
112 + not sys.stdout.isatty():
113 spinner.update = spinner.update_basic
114
115 if myaction == 'version':
116
117 Modified: main/branches/2.1.7/pym/portage/getbinpkg.py
118 ===================================================================
119 --- main/branches/2.1.7/pym/portage/getbinpkg.py 2010-01-29 18:47:30 UTC (rev 15245)
120 +++ main/branches/2.1.7/pym/portage/getbinpkg.py 2010-01-29 18:47:51 UTC (rev 15246)
121 @@ -638,7 +638,7 @@
122 self.out.flush()
123
124 cache_stats = CacheStats(out)
125 - have_tty = out.isatty()
126 + have_tty = os.environ.get('TERM') != 'dumb' and out.isatty()
127 if have_tty:
128 cache_stats.display()
129 binpkg_filenames = set()