diff options
author | Pascal Rigaux <pixel@mandriva.com> | 1999-09-27 20:52:11 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 1999-09-27 20:52:11 +0000 |
commit | f902492a01c974283c9c800ddbd5de651c474c25 (patch) | |
tree | 4a8eb59f4644fb18ef8e3a448c79061643b60145 /perl-install/run_program.pm | |
parent | 73e7a0f1107be369f7304335082afac4f96ee3d2 (diff) | |
download | drakx-backup-do-not-use-f902492a01c974283c9c800ddbd5de651c474c25.tar drakx-backup-do-not-use-f902492a01c974283c9c800ddbd5de651c474c25.tar.gz drakx-backup-do-not-use-f902492a01c974283c9c800ddbd5de651c474c25.tar.bz2 drakx-backup-do-not-use-f902492a01c974283c9c800ddbd5de651c474c25.tar.xz drakx-backup-do-not-use-f902492a01c974283c9c800ddbd5de651c474c25.zip |
no_comment
Diffstat (limited to 'perl-install/run_program.pm')
-rw-r--r-- | perl-install/run_program.pm | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/perl-install/run_program.pm b/perl-install/run_program.pm index 0f0d70eeb..7e91437e7 100644 --- a/perl-install/run_program.pm +++ b/perl-install/run_program.pm @@ -17,12 +17,18 @@ sub rooted { fork and wait, return $? == 0; { - my ($stdout, $stdoutm); - ($stdoutm, $stdout, @args) = @args if $args[0] eq ">" || $args[0] eq ">>"; + my ($stdout, $stdoutm, $stderr, $stderrm); + ($stdoutm, $stdout, @args) = @args if $args[0] =~ /^>>?$/; + ($stderrm, $stderr, @args) = @args if $args[0] =~ /^2>>?$/; 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 "run_program can't log :("; + if ($stderr) { + $stderrm =~ s/2//; + open STDERR, "$stderrm $root$stderr" or die "run_program can't output in $root$stderr (mode `$stderrm')"; + } else { + 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 { |