Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r11680 - main/trunk/pym/_emerge
Date: Sun, 12 Oct 2008 00:47:03
Message-Id: E1Kop6q-0007Qu-Gt@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-10-12 00:46:59 +0000 (Sun, 12 Oct 2008)
3 New Revision: 11680
4
5 Modified:
6 main/trunk/pym/_emerge/__init__.py
7 Log:
8 Buge #241100 - Make EbuildFetcher use a pty when appropriate, so that fetcher
9 progress bars, like wget has, will work properly.
10
11
12 Modified: main/trunk/pym/_emerge/__init__.py
13 ===================================================================
14 --- main/trunk/pym/_emerge/__init__.py 2008-10-12 00:09:40 UTC (rev 11679)
15 +++ main/trunk/pym/_emerge/__init__.py 2008-10-12 00:46:59 UTC (rev 11680)
16 @@ -2279,6 +2279,18 @@
17 self.env = fetch_env
18 SpawnProcess._start(self)
19
20 + def _pipe(self, fd_pipes):
21 + """When appropriate, use a pty so that fetcher progress bars,
22 + like wget has, will work properly."""
23 + if self.prefetch or self.background or not sys.stdout.isatty():
24 + # When the output only goes to a log file,
25 + # there's no point in creating a pty.
26 + return os.pipe()
27 + stdout_pipe = fd_pipes.get(1)
28 + got_pty, master_fd, slave_fd = \
29 + portage._create_pty_or_pipe(copy_term_size=stdout_pipe)
30 + return (master_fd, slave_fd)
31 +
32 def _clean_builddir(self):
33 """Uses shutil.rmtree() rather than spawning a 'clean' phase. Disabled
34 by keepwork or keeptemp in FEATURES."""