Don't use yes command sub-process

This commit is contained in:
Jamie Cameron
2008-04-30 20:55:44 +00:00
parent b67289a14d
commit 98bcaafe99
2 changed files with 8 additions and 2 deletions

View File

@@ -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);

View File

@@ -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;