diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-12-13 09:27:38 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-12-13 09:27:38 -0800 |
commit | a3797a63a30579be3ba5418aad7e76fd520f9aee (patch) | |
tree | 7290667d4461b5c9a2f4f963d2816c5a5ccac278 | |
parent | 70d7c7bfb20dec3fa66b0e6c1d9729ac87cab577 (diff) | |
download | portage-a3797a63a30579be3ba5418aad7e76fd520f9aee.tar.gz portage-a3797a63a30579be3ba5418aad7e76fd520f9aee.tar.bz2 portage-a3797a63a30579be3ba5418aad7e76fd520f9aee.zip |
AbstractEbuildProcess: null in if not interactive
-rw-r--r-- | pym/_emerge/AbstractEbuildProcess.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py index 4147ecb7b..6e1491bbe 100644 --- a/pym/_emerge/AbstractEbuildProcess.py +++ b/pym/_emerge/AbstractEbuildProcess.py @@ -92,7 +92,19 @@ class AbstractEbuildProcess(SpawnProcess): else: self.settings.pop('PORTAGE_EBUILD_EXIT_FILE', None) - SpawnProcess._start(self) + if self.fd_pipes is None: + self.fd_pipes = {} + null_fd = None + if 0 not in self.fd_pipes and \ + "interactive" not in self.settings.get("PROPERTIES", "").split(): + null_fd = os.open('/dev/null', os.O_RDONLY) + self.fd_pipes[0] = null_fd + + try: + SpawnProcess._start(self) + finally: + if null_fd is not None: + os.close(null_fd) def _init_ipc_fifos(self): |