summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2002-08-20 17:29:12 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2002-08-20 17:29:12 +0000
commit717917c97697a47d75e7644150ee26f8e8052c2e (patch)
tree9c7aaa94552b9ada1c6cd2f17945fbb2714addf3 /perl-install
parent76cba373cce1bab319df7402f242d9d57d9ad166 (diff)
downloaddrakx-backup-do-not-use-717917c97697a47d75e7644150ee26f8e8052c2e.tar
drakx-backup-do-not-use-717917c97697a47d75e7644150ee26f8e8052c2e.tar.gz
drakx-backup-do-not-use-717917c97697a47d75e7644150ee26f8e8052c2e.tar.bz2
drakx-backup-do-not-use-717917c97697a47d75e7644150ee26f8e8052c2e.tar.xz
drakx-backup-do-not-use-717917c97697a47d75e7644150ee26f8e8052c2e.zip
- kill dead code
- more use of MDK::Common
Diffstat (limited to 'perl-install')
-rwxr-xr-xperl-install/standalone/service_harddrake24
1 files changed, 3 insertions, 21 deletions
diff --git a/perl-install/standalone/service_harddrake b/perl-install/standalone/service_harddrake
index 347c7cd60..b0da37509 100755
--- a/perl-install/standalone/service_harddrake
+++ b/perl-install/standalone/service_harddrake
@@ -12,24 +12,12 @@ use Storable qw(store retrieve);
my $hw_sysconfdir = "/etc/sysconfig/harddrake2";
my $last_boot_config = $hw_sysconfdir."/previous_hw";
-my $str = '#!/usr/bin/perl -w
-#
-# Special file generated by harddrake service (cvs revision $Revision$).
-# Do not alter it; it\'ll be overwritten by harddrake2 service
-#
-# Format is : { Config_class_ID => {
-# Device => {
-# _Fields => values} ...} ...}
-#
-';
-
# first run ? if not read old hw config
my %previous_config = (-f $last_boot_config && -s $last_boot_config) ? retrieve($last_boot_config) : {};
my (%config, $in);
-# For each hw, class, detect device, compare and offer to reconfigure if
-# needed
+# For each hw, class, detect device, compare and offer to reconfigure if needed
foreach (@harddrake::data::tree) {
my ($Ident, $item, undef, $configurator, $detector, $do_it) = @$_;
next unless $do_it;
@@ -38,13 +26,7 @@ foreach (@harddrake::data::tree) {
my %ID = map {
my $i = $_;
- my $name = do {
- if (defined $i->{device}) {
- $i->{device};
- } else {
- join ':', map { $i->{$_} } qw(vendor id subvendor subid);
- }
- };
+ my $name = if_(defined $i->{device}, [$i->{device}, join ':', map { $i->{$_} } qw(vendor id subvendor subid)]);
$name => $i;
} &$detector;
$config{$Ident} = \%ID;
@@ -79,7 +61,7 @@ foreach (@harddrake::data::tree) {
next unless ($@ && $res); # timed out || canceled
if (my $pid = fork) {
require POSIX;
- POSIX::wait();
+ POSIX::wait();
} else {
exec("$configurator 2>/dev/null") or die "$configurator missing\n";
}