diff options
author | Francois Pons <fpons@mandriva.com> | 2001-02-27 14:27:24 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2001-02-27 14:27:24 +0000 |
commit | 2930876e55207dd1cdf8f3511825f4bbf90e2585 (patch) | |
tree | a851bde8c6b14308fd37374b1b342abcac9257ce /urpmi | |
parent | ad313cad5995b640509ae48123c3e2c0f24ea38c (diff) | |
download | urpmi-2930876e55207dd1cdf8f3511825f4bbf90e2585.tar urpmi-2930876e55207dd1cdf8f3511825f4bbf90e2585.tar.gz urpmi-2930876e55207dd1cdf8f3511825f4bbf90e2585.tar.bz2 urpmi-2930876e55207dd1cdf8f3511825f4bbf90e2585.tar.xz urpmi-2930876e55207dd1cdf8f3511825f4bbf90e2585.zip |
*** empty log message ***
Diffstat (limited to 'urpmi')
-rwxr-xr-x | urpmi | 26 |
1 files changed, 22 insertions, 4 deletions
@@ -100,10 +100,28 @@ for (@ARGV) { #- log only at this point in case of query usage. log_it(scalar localtime, " urpmi called with @ARGV\n"); -open SAVEOUT, ">&STDOUT"; -open SAVEERR, ">&STDERR"; -open STDOUT, "|-", "tee >&SAVEOUT -a /var/log/urpmi.log" or die; -open STDERR, "|-", "tee >&SAVEERR -a /var/log/urpmi.log" or die; +my ($pid_out, $pid_err); + +open SAVEOUT, ">&STDOUT"; select SAVEOUT; $| = 1; +open SAVEERR, ">&STDERR"; select SAVEERR; $| = 1; +unless ($pid_out = open STDOUT, "|-") { + open F, ">>/var/log/urpmi.log"; select F; $| = 1; + while (<STDIN>) { + print SAVEOUT $_; + print F $_; + } + close F; + exit 0; +} +unless ($pid_err = open STDERR, "|-") { + open F, ">>/var/log/urpmi.log"; select F; $| = 1; + while (<STDIN>) { + print SAVEERR $_; + print F $_; + } + close F; + exit 0; +} select STDERR; $| = 1; # make unbuffered select STDOUT; $| = 1; # make unbuffered |