diff options
author | Pascal Rigaux <pixel@mandriva.com> | 1999-09-04 21:49:40 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 1999-09-04 21:49:40 +0000 |
commit | bcd1bf4e45de7e5f59a6c1e7eaaf7ad401d7fc28 (patch) | |
tree | 01e2e993eee17983f2d616caecc998cc3dba5acf /perl-install/modules.pm | |
parent | beb56af292cfc8f5ed3e78034da33e96ca9e7953 (diff) | |
download | drakx-backup-do-not-use-bcd1bf4e45de7e5f59a6c1e7eaaf7ad401d7fc28.tar drakx-backup-do-not-use-bcd1bf4e45de7e5f59a6c1e7eaaf7ad401d7fc28.tar.gz drakx-backup-do-not-use-bcd1bf4e45de7e5f59a6c1e7eaaf7ad401d7fc28.tar.bz2 drakx-backup-do-not-use-bcd1bf4e45de7e5f59a6c1e7eaaf7ad401d7fc28.tar.xz drakx-backup-do-not-use-bcd1bf4e45de7e5f59a6c1e7eaaf7ad401d7fc28.zip |
no_comment
Diffstat (limited to 'perl-install/modules.pm')
-rw-r--r-- | perl-install/modules.pm | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/perl-install/modules.pm b/perl-install/modules.pm index 5ca395645..da89bae31 100644 --- a/perl-install/modules.pm +++ b/perl-install/modules.pm @@ -11,6 +11,7 @@ use log; my %conf; +my $scsi = 0; my %deps = (); @@ -242,7 +243,7 @@ sub text2driver($) { sub load($;$@) { my ($name, $type, @options) = @_; - $conf{'scsi_hostadapter' . ($conf{scsi}++ || '')}{alias} = $name + $conf{'scsi_hostadapter' . ($scsi++ || '')}{alias} = $name if $type eq 'scsi'; if ($::testing) { @@ -301,20 +302,19 @@ sub load_deps($) { } } -sub read_conf { - my ($file) = @_; +sub read_conf($;$) { + my ($file, $scsi) = @_; my %c; - $c{scsi} = 0; foreach (cat_($file)) { do { $c{$2}{$1} = $3; - $c{scsi} = max($c{scsi}, $1 || 0) if /^\s*alias\s+scsi_hostadapter (\d*)/x; + $$scsi = max($$scsi, $1 || 0) if /^\s*alias\s+scsi_hostadapter (\d*)/x && $scsi; } if /^\s*(\S+)\s+(\S+)\s+(.*?)\s*$/; } # cheating here: not handling aliases of aliases while (my ($k, $v) = each %c) { - $c{scsi} ||= $v->{scsi_hostadapter}; + $$scsi ||= $v->{scsi_hostadapter} if $scsi; if (my $a = $v->{alias}) { local $c{$a}{alias}; add2hash($c{$a}, $v); @@ -325,7 +325,7 @@ sub read_conf { sub write_conf { my ($file) = @_; - my %written = read_conf($file); + my (undef, %written) = read_conf($file); local *F; open F, ">> $file" or die("cannot write module config file $file: $!\n"); @@ -338,7 +338,7 @@ sub write_conf { } sub get_stage1_conf { - %conf = read_conf($_[0]); + %conf = read_conf($_[0], \$scsi); $conf{parport_lowlevel}{alias} ||= "parport_pc"; $conf{pcmcia_core}{"pre-install"} ||= "/etc/rc.d/init.d/pcmcia start"; $conf{plip}{"pre-install"} ||= "modprobe parport_pc ; echo 7 > /proc/parport/0/irq"; @@ -356,7 +356,7 @@ sub load_thiskind($;&) { $drivers{$mod} or log::l("module $mod not in install table"), next; log::l("found driver for $mod"); &$f($text, $mod) if $f; - load($mod); + load($mod, $type); } @devs; } |