/[soft]/drakx/trunk/perl-install/standalone/service_harddrake
ViewVC logotype

Diff of /drakx/trunk/perl-install/standalone/service_harddrake

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 916 by anssi, Sun Apr 17 14:33:45 2011 UTC revision 917 by anssi, Sun Apr 17 14:33:49 2011 UTC
# Line 72  if (!member($curr_kernel, chomp_(cat_($k Line 72  if (!member($curr_kernel, chomp_(cat_($k
72      append_to_file($known_kernels, "$curr_kernel\n");      append_to_file($known_kernels, "$curr_kernel\n");
73  }  }
74    
75    sub ask_with_timeout {
76        my ($title, $msg, $timeout, $plymouth) = @_;
77        my ($pid, $res, $timed_out);
78    
79        $SIG{ALRM} = sub { $timed_out = 1; kill 15, $pid };
80        unless ($pid = fork()) {
81            $plymouth and system('plymouth', 'hide-splash');
82            exec("/usr/share/harddrake/confirm", $title, $msg);
83        }
84        alarm($timeout);
85        wait();
86        $res = $?;
87        alarm(0);
88        return $res, $timed_out;
89    }
90    
91  sub get_xorg_driver() {  sub get_xorg_driver() {
92      my $x = Xconfig::xfree->read;      my $x = Xconfig::xfree->read;
93      if ($x) {      if ($x) {
# Line 332  foreach my $hw_class (@harddrake::data:: Line 348  foreach my $hw_class (@harddrake::data::
348          log::explanations(qw(skip $Ident configuration since "$configurator" is not executable));          log::explanations(qw(skip $Ident configuration since "$configurator" is not executable));
349          next;          next;
350      }      }
351      my ($pid, $no, $res);      my ($no, $res);
352      $hw_class->{automatic} ||= ref($configurator) eq 'CODE';      $hw_class->{automatic} ||= ref($configurator) eq 'CODE';
353    
354      if (!$hw_class->{automatic}) {      if (!$hw_class->{automatic}) {
355          $SIG{ALRM} = sub { $no = 1; kill 15, $pid };          ($res, $no) = ask_with_timeout(N("Hardware changes in \"%s\" class (%s seconds to answer)", $Ident, $timeout),
356          unless ($pid = fork()) {                                      $msg . N("Do you want to run the appropriate config tool?"), $timeout, $plymouth);
             $plymouth and system('plymouth', 'hide-splash');  
             exec("/usr/share/harddrake/confirm", $Ident, $timeout, $msg);  
         }  
         alarm($timeout);  
         wait();  
         $res = $?;  
         alarm(0);  
357      } else {      } else {
358          $res = 1;          $res = 1;
359      }      }

Legend:
Removed from v.916  
changed lines
  Added in v.917

  ViewVC Help
Powered by ViewVC 1.1.30