1 |
commit: 1811def4b0ebc8af2280dde7f84331301b4eddd3 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Oct 29 21:41:38 2011 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Oct 29 21:41:38 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1811def4 |
7 |
|
8 |
EbuildMetadataPhase: use /dev/null for stdin |
9 |
|
10 |
--- |
11 |
pym/_emerge/EbuildMetadataPhase.py | 4 +++- |
12 |
pym/_emerge/actions.py | 6 ------ |
13 |
2 files changed, 3 insertions(+), 7 deletions(-) |
14 |
|
15 |
diff --git a/pym/_emerge/EbuildMetadataPhase.py b/pym/_emerge/EbuildMetadataPhase.py |
16 |
index bf562c5..16948df 100644 |
17 |
--- a/pym/_emerge/EbuildMetadataPhase.py |
18 |
+++ b/pym/_emerge/EbuildMetadataPhase.py |
19 |
@@ -63,7 +63,8 @@ class EbuildMetadataPhase(SubProcess): |
20 |
else: |
21 |
fd_pipes = {} |
22 |
|
23 |
- fd_pipes.setdefault(0, sys.stdin.fileno()) |
24 |
+ null_input = open('/dev/null', 'rb') |
25 |
+ fd_pipes.setdefault(0, null_input.fileno()) |
26 |
fd_pipes.setdefault(1, sys.stdout.fileno()) |
27 |
fd_pipes.setdefault(2, sys.stderr.fileno()) |
28 |
|
29 |
@@ -96,6 +97,7 @@ class EbuildMetadataPhase(SubProcess): |
30 |
fd_pipes=fd_pipes, returnpid=True) |
31 |
|
32 |
os.close(slave_fd) |
33 |
+ null_input.close() |
34 |
|
35 |
if isinstance(retval, int): |
36 |
# doebuild failed before spawning |
37 |
|
38 |
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py |
39 |
index 28fe549..036b471 100644 |
40 |
--- a/pym/_emerge/actions.py |
41 |
+++ b/pym/_emerge/actions.py |
42 |
@@ -1864,12 +1864,6 @@ def action_regen(settings, portdb, max_jobs, max_load): |
43 |
xterm_titles = "notitles" not in settings.features |
44 |
emergelog(xterm_titles, " === regen") |
45 |
#regenerate cache entries |
46 |
- try: |
47 |
- os.close(sys.stdin.fileno()) |
48 |
- except SystemExit: |
49 |
- raise # Needed else can't exit |
50 |
- except: |
51 |
- pass |
52 |
sys.stdout.flush() |
53 |
|
54 |
regen = MetadataRegen(portdb, max_jobs=max_jobs, max_load=max_load) |