summaryrefslogtreecommitdiffstats
path: root/pym/_emerge/AbstractEbuildProcess.py
diff options
context:
space:
mode:
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)