From 992528cdd70f08a19d77dcaf15e7bc1bd2097da1 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 23 Apr 2004 12:03:43 +0000 Subject: - when automatic flag is set for one hardware class, do not ask for confirmation and just do what is needed - only show "probing in progress" message if we did run an interactive tool --- perl-install/standalone/service_harddrake | 34 ++++++++++++++++++------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/perl-install/standalone/service_harddrake b/perl-install/standalone/service_harddrake index 20e43e995..32704fc24 100755 --- a/perl-install/standalone/service_harddrake +++ b/perl-install/standalone/service_harddrake @@ -94,27 +94,33 @@ foreach my $hw_class (@harddrake::data::tree) { } next unless -x first(split /\s+/, $configurator_pool[0]); - my ($pid, $no); - $SIG{ALRM} = sub { $no = 1; kill 15, $pid }; - unless ($pid = fork()) { - exec("/usr/share/harddrake/confirm", $Ident, $timeout, $msg); + my ($pid, $no, $res); + if (!$hw_class->{automatic}) { + $SIG{ALRM} = sub { $no = 1; kill 15, $pid }; + unless ($pid = fork()) { + exec("/usr/share/harddrake/confirm", $Ident, $timeout, $msg); + } + alarm($timeout); + wait(); + $res = $?; + alarm(0); + } else { + $res = 1; } - alarm($timeout); - wait(); - my $res = $?; - alarm(0); - if ($no) { - require interactive; - undef $wait; - $in ||= interactive->vnew; - $wait = $in->wait_message(N("Please wait"), N("Hardware probing in progress")); - } elsif ($res) { + if ($res) { foreach my $configurator (@configurator_pool) { if (fork()) { wait(); } else { exec("$configurator 2>/dev/null") or die "$configurator missing\n" } } } + if (!$hw_class->{automatic}) { + require interactive; + undef $wait; + $in ||= interactive->vnew; + $wait = $in->wait_message(N("Please wait"), N("Hardware probing in progress")); + } + } # output new hw config -- cgit v1.2.1