Properly capture error output
authorJamie Cameron <jcameron@webmin.com>
Tue, 19 Aug 2008 06:15:41 +0000 (06:15 +0000)
committerJamie Cameron <jcameron@webmin.com>
Tue, 19 Aug 2008 06:15:41 +0000 (06:15 +0000)
software/apt-lib.pl
software/csw-lib.pl
software/rhn-lib.pl
software/urpmi-lib.pl
software/yum-lib.pl

index 0e170cd..192940f 100644 (file)
@@ -24,7 +24,7 @@ foreach (0..100) {
        &print_tempfile(YESFILE, "Yes\n");
        }
 &close_tempfile(YESFILE);
-&open_execute_command(CMD, "$cmd 2>&1 <$yesfile", 1);
+&open_execute_command(CMD, "$cmd <$yesfile", 2);
 while(<CMD>) {
        if (/setting\s+up\s+(\S+)/i && !/as\s+MDA/i) {
                push(@rv, $1);
index 32c1c6c..1facc5b 100644 (file)
@@ -28,7 +28,7 @@ do {
        $failed = 0;
        $retry = 0;
        print "<pre>";
-       &open_execute_command(PKGGET, "$pkg_get -i -f ".quotemeta($update), 1);
+       &open_execute_command(PKGGET, "$pkg_get -i -f ".quotemeta($update), 2);
        while(<PKGGET>) {
                if (!/^\s*\d+\%\s+\[/) {
                        # Output everything except download lines
index 8e910cd..71c07d3 100644 (file)
@@ -14,7 +14,7 @@ print "<b>",&text('rhn_install', "<tt>up2date $update</tt>"),"</b><p>\n";
 print "<pre>";
 &additional_log('exec', undef, "up2date \"$update\"");
 local $qm = quotemeta($update);
-&open_execute_command(CMD, "up2date $qm 2>&1", 1);
+&open_execute_command(CMD, "up2date $qm", 2);
 local $got_error = 0;
 while(<CMD>) {
        while(s/^[^\015]+\015([^\012])/$1/) { }
index 2309a94..161e876 100644 (file)
@@ -12,7 +12,7 @@ print "<b>",&text('urpmi_install', "<tt>$cmd $update</tt>"),"</b><p>\n";
 print "<pre>";
 &additional_log('exec', undef, "$cmd $update");
 local $qm = join(" ", map { quotemeta($_) } split(/\s+/, $update));
-&open_execute_command(CMD, "$cmd $qm 2>&1 </dev/null", 1);
+&open_execute_command(CMD, "$cmd $qm </dev/null", 2);
 while(<CMD>) {
        s/\r|\n//g;
        if (/installing\s+(\S+)\s+from/) {
index f5b1787..9662061 100644 (file)
@@ -18,7 +18,7 @@ print "<b>",&text('yum_install', "<tt>yum $enable -y install $update</tt>"),"</b
 print "<pre>";
 &additional_log('exec', undef, "yum $enable -y install $update");
 local $qm = join(" ", map { quotemeta($_) } split(/\s+/, $update));
-&open_execute_command(CMD, "yum $enable -y install $qm 2>&1 </dev/null", 1);
+&open_execute_command(CMD, "yum $enable -y install $qm </dev/null", 2);
 while(<CMD>) {
        s/\r|\n//g;
        if (/^\[(update|install|deps):\s+(\S+)\s+/) {