diff options
author | 2009-06-16 20:05:50 -0400 | |
---|---|---|
committer | 2009-06-16 20:05:50 -0400 | |
commit | 24f5009d377e7cca46f923bc8d3ed54de598993e (patch) | |
tree | 435756b6a592503b321def03668bb666b3799be3 /backend/functions/execution.php | |
parent | Got up to emerging system, started on child process logging (diff) | |
download | ingenue-24f5009d377e7cca46f923bc8d3ed54de598993e.tar.gz ingenue-24f5009d377e7cca46f923bc8d3ed54de598993e.tar.bz2 ingenue-24f5009d377e7cca46f923bc8d3ed54de598993e.zip |
Integrated log_command and tried emerge system; added PORTAGE_TMPDIR to the target environment
Diffstat (limited to 'backend/functions/execution.php')
-rw-r--r-- | backend/functions/execution.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/backend/functions/execution.php b/backend/functions/execution.php index 75d9da8..e1d64b4 100644 --- a/backend/functions/execution.php +++ b/backend/functions/execution.php @@ -11,16 +11,19 @@ function log_command($id, $command, $path=null, $env=null) { } while (true) { $status=proc_get_status($p); - $s=stream_select(array($pipes[1], $pipes[2]), array(), array(), 1); + // We have to set these all to variables because stream_select requires pass by reference + $null=null; + $outs=array($pipes[1], $pipes[2]); + $s=stream_select($outs, $null, $null, 1); if ($s) { $c=stream_get_contents($pipes[2]); // TODO this really needs to go to the DB and carry metadata if ($c) { - log_msg($c); // STDERR + log_msg($c, false); // STDERR } $c=stream_get_contents($pipes[1]); if ($c) { - log_msg($c); // STDOUT + log_msg($c, false); // STDOUT } } if ($status['running'] === false) { @@ -32,5 +35,6 @@ function log_command($id, $command, $path=null, $env=null) { } $exit_status=proc_close($p); // Handle end status + return $exit_status; } ?> |