diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-12-06 11:02:00 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-12-06 11:02:00 +0000 |
commit | 3b44e1cda7791c2f8dcc1dac44834d04dd360717 (patch) | |
tree | a81ad7ee650d03c6a96fe1ab613291226d0a7814 /pym/_emerge/EbuildProcess.py | |
parent | 7a058619e11d8544d5edc8641390ea33877fa90a (diff) | |
download | portage-3b44e1cda7791c2f8dcc1dac44834d04dd360717.tar.gz portage-3b44e1cda7791c2f8dcc1dac44834d04dd360717.tar.bz2 portage-3b44e1cda7791c2f8dcc1dac44834d04dd360717.zip |
Add a AbstractEbuildProcess class for MiscFunctionsProcess to inherit the
_pipe and _can_log methods that used to be in the EbuildProcess class.
(trunk r14933)
svn path=/main/branches/2.1.7/; revision=14947
Diffstat (limited to 'pym/_emerge/EbuildProcess.py')
-rw-r--r-- | pym/_emerge/EbuildProcess.py | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/pym/_emerge/EbuildProcess.py b/pym/_emerge/EbuildProcess.py index a6a0b362b..597caf4dd 100644 --- a/pym/_emerge/EbuildProcess.py +++ b/pym/_emerge/EbuildProcess.py @@ -2,13 +2,13 @@ # Distributed under the terms of the GNU General Public License v2 # $Id$ -from _emerge.SpawnProcess import SpawnProcess +from _emerge.AbstractEbuildProcess import AbstractEbuildProcess import portage from portage import os -class EbuildProcess(SpawnProcess): +class EbuildProcess(AbstractEbuildProcess): - __slots__ = ("phase", "pkg", "settings", "tree") + __slots__ = ('tree',) def _start(self): # Don't open the log file during the clean phase since the @@ -16,20 +16,7 @@ class EbuildProcess(SpawnProcess): # prevents the clean phase from removing $T. if self.phase not in ("clean", "cleanrm"): self.logfile = self.settings.get("PORTAGE_LOG_FILE") - SpawnProcess._start(self) - - def _pipe(self, fd_pipes): - stdout_pipe = fd_pipes.get(1) - got_pty, master_fd, slave_fd = \ - portage._create_pty_or_pipe(copy_term_size=stdout_pipe) - return (master_fd, slave_fd) - - def _can_log(self, slave_fd): - # With sesandbox, logging works through a pty but not through a - # normal pipe. So, disable logging if ptys are broken. - # See Bug #162404. - return not ('sesandbox' in self.settings.features \ - and self.settings.selinux_enabled()) or os.isatty(slave_fd) + AbstractEbuildProcess._start(self) def _spawn(self, args, **kwargs): @@ -47,7 +34,7 @@ class EbuildProcess(SpawnProcess): return rval def _set_returncode(self, wait_retval): - SpawnProcess._set_returncode(self, wait_retval) + AbstractEbuildProcess._set_returncode(self, wait_retval) if self.phase not in ("clean", "cleanrm"): self.returncode = portage._doebuild_exit_status_check_and_log( |