mirror of
https://github.com/webmin/webmin.git
synced 2026-05-04 22:30:33 +01:00
Don't use yes command sub-process
This commit is contained in:
@@ -18,7 +18,13 @@ print "<b>",&text('apt_install', "<tt>$cmd</tt>"),"</b><p>\n";
|
||||
print "<pre>";
|
||||
$update = join(" ", map { quotemeta($_) } split(/\s+/, $update));
|
||||
&additional_log('exec', undef, $cmd);
|
||||
&open_execute_command(CMD, "yes Yes | $cmd 2>&1", 1);
|
||||
local $yesfile = &transname();
|
||||
&open_tempfile(YESFILE, ">$yesfile", 0, 1);
|
||||
foreach (0..100) {
|
||||
&print_tempfile(YESFILE, "Yes\n");
|
||||
}
|
||||
&close_tempfile(YESFILE);
|
||||
&open_execute_command(CMD, "$cmd 2>&1 <$yesfile", 1);
|
||||
while(<CMD>) {
|
||||
if (/setting\s+up\s+(\S+)/i && !/as\s+MDA/i) {
|
||||
push(@rv, $1);
|
||||
|
||||
@@ -10,7 +10,7 @@ local $arg = @_ ? join(" ", map { quotemeta($_) } @_) : "";
|
||||
&open_execute_command(PKGINFO, "COLUMNS=200 dpkg --list $arg", 1, 1);
|
||||
while(<PKGINFO>) {
|
||||
next if (/^\|/ || /^\+/);
|
||||
if (/^[ri]i..(\S+)\s+(\S+)\s+(.*)/) {
|
||||
if (/^[uirph]i..(\S+)\s+(\S+)\s+(.*)/) {
|
||||
$packages{$i,'name'} = $1;
|
||||
$packages{$i,'class'} = &alphabet_name($1);
|
||||
$packages{$i,'version'} = $2;
|
||||
|
||||
Reference in New Issue
Block a user