summaryrefslogtreecommitdiffstats
path: root/pym/_emerge/AbstractEbuildProcess.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-12-06 08:03:46 +0000
committerZac Medico <zmedico@gentoo.org>2009-12-06 08:03:46 +0000
commit0aad441b68c56e2fe443133ae7e91dad749abc19 (patch)
tree7dbbedee1816be4289fa4fff7310772515743e43 /pym/_emerge/AbstractEbuildProcess.py
parent512e554dbf5e79fd391fc251568841e5528543ff (diff)
downloadportage-0aad441b68c56e2fe443133ae7e91dad749abc19.tar.gz
portage-0aad441b68c56e2fe443133ae7e91dad749abc19.tar.bz2
portage-0aad441b68c56e2fe443133ae7e91dad749abc19.zip
Add a AbstractEbuildProcess class for MiscFunctionsProcess to inherit the
_pipe and _can_log methods that used to be in the EbuildProcess class. svn path=/main/trunk/; revision=14933
Diffstat (limited to 'pym/_emerge/AbstractEbuildProcess.py')
-rw-r--r--pym/_emerge/AbstractEbuildProcess.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py
new file mode 100644
index 000000000..db599019c
--- /dev/null
+++ b/pym/_emerge/AbstractEbuildProcess.py
@@ -0,0 +1,24 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+from _emerge.SpawnProcess import SpawnProcess
+import portage
+from portage import os
+
+class AbstractEbuildProcess(SpawnProcess):
+
+ __slots__ = ('phase', 'pkg', 'settings',)
+
+ 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)