summaryrefslogtreecommitdiffstats
path: root/perl-install/run_program.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-09-19 14:49:36 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-09-19 14:49:36 +0000
commit4710960f1314ec790ea876f0e50250cac59e089c (patch)
treeebf7ffacad519615bc779e28e108af7fff27d14b /perl-install/run_program.pm
parentbb1b2617bc36e258f13d375faaaec1bfff97080e (diff)
downloaddrakx-4710960f1314ec790ea876f0e50250cac59e089c.tar
drakx-4710960f1314ec790ea876f0e50250cac59e089c.tar.gz
drakx-4710960f1314ec790ea876f0e50250cac59e089c.tar.bz2
drakx-4710960f1314ec790ea876f0e50250cac59e089c.tar.xz
drakx-4710960f1314ec790ea876f0e50250cac59e089c.zip
no_comment
Diffstat (limited to 'perl-install/run_program.pm')
-rw-r--r--perl-install/run_program.pm11
1 files changed, 9 insertions, 2 deletions
diff --git a/perl-install/run_program.pm b/perl-install/run_program.pm
index 617c6ebd5..b36c8744b 100644
--- a/perl-install/run_program.pm
+++ b/perl-install/run_program.pm
@@ -17,10 +17,17 @@ sub rooted {
fork and wait, return $? == 0;
{
+ my ($stdout, $stdoutm);
+ ($stdoutm, $stdout, @args) = @args if $args[0] eq ">" || $args[0] eq ">>";
+
open STDIN, "/dev/null" or die "can't open /dev/null as stdin";
- open STDERR, ">> /dev/tty7" or open STDERR, ">> /tmp/exec.log" or die "runProgramRoot can't log :(";
- open STDOUT, ">> /dev/tty7" or open STDOUT, ">> /tmp/exec.log" or die "runProgramRoot can't log :(";
+ open STDERR, ">> /dev/tty7" or open STDERR, ">> /tmp/exec.log" or die "run_program can't log :(";
+ if ($stdout) {
+ open STDOUT, "$stdoutm $root$stdout" or die "run_program can't output in $root$stdout (mode `$stdoutm')";
+ } else {
+ open STDOUT, ">> /dev/tty7" or open STDOUT, ">> /tmp/exec.log" or die "run_program can't log :(";
+ }
$root and chroot $root;
chdir "/";