summaryrefslogtreecommitdiffstats
path: root/perl-install/modules.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-07-08 01:21:42 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-07-08 01:21:42 +0000
commit149bb85110e0f6de5f16d8acbb636644c4fb114d (patch)
tree73a8d37d44e3e7f436118d7d62d353b8111f2324 /perl-install/modules.pm
parent0dbe0e74dd84b15f5949035455e3ef1fa568b728 (diff)
downloaddrakx-149bb85110e0f6de5f16d8acbb636644c4fb114d.tar
drakx-149bb85110e0f6de5f16d8acbb636644c4fb114d.tar.gz
drakx-149bb85110e0f6de5f16d8acbb636644c4fb114d.tar.bz2
drakx-149bb85110e0f6de5f16d8acbb636644c4fb114d.tar.xz
drakx-149bb85110e0f6de5f16d8acbb636644c4fb114d.zip
- rename add_alias() into set_alias()
- create set_sound_slot() and use it
Diffstat (limited to 'perl-install/modules.pm')
-rw-r--r--perl-install/modules.pm18
1 files changed, 13 insertions, 5 deletions
diff --git a/perl-install/modules.pm b/perl-install/modules.pm
index dc71ad5e1..085abf894 100644
--- a/perl-install/modules.pm
+++ b/perl-install/modules.pm
@@ -87,7 +87,7 @@ sub load {
sleep 2 if any { /^(usb-storage|mousedev|printer)$/ } @l;
if ($network_module) {
- add_alias($_, $network_module) foreach difference2([ detect_devices::getNet() ], \@network_devices);
+ set_alias($_, $network_module) foreach difference2([ detect_devices::getNet() ], \@network_devices);
}
when_load($_, @{$options{$_}}) foreach @l;
}
@@ -173,13 +173,12 @@ sub set_options {
log::l(qq(set option "$new_option" for module "$name"));
$conf{$name}{options} = $new_option;
}
-sub add_alias {
+sub set_alias {
my ($alias, $module) = @_;
$module =~ /ignore/ and return;
/\Q$alias/ && $conf{$_}{alias} && $conf{$_}{alias} eq $module and return $_ foreach keys %conf;
log::l("adding alias $alias to $module");
$conf{$alias}{alias} = $module;
- $conf{$module}{above} = 'snd-pcm-oss' if $module =~ /^snd-/;
$alias;
}
sub add_probeall {
@@ -227,6 +226,15 @@ sub remove_module {
0;
}
+sub set_sound_slot {
+ my ($alias, $module) = @_;
+ if (my $old = $conf{$alias}{alias}) {
+ $conf{$old} and delete $conf{$old}{above};
+ }
+ set_alias($alias, $module);
+ $conf{$module}{above} = 'snd-pcm-oss' if $module =~ /^snd-/;
+}
+
sub read_conf {
my ($file) = @_;
my %c;
@@ -396,11 +404,11 @@ sub when_load {
} elsif ($category eq 'bus/usb') {
add_probeall('usb-interface', $name);
} elsif ($category eq 'bus/firewire') {
- add_alias('ieee1394-controller', $name);
+ set_alias('ieee1394-controller', $name);
} elsif ($category =~ /sound/) {
my $sound_alias = find { /^sound-slot-[0-9]+$/ && $conf{$_}{alias} eq $name } keys %conf;
$sound_alias ||= 'sound-slot-0';
- add_alias($sound_alias, $name);
+ set_sound_slot($sound_alias, $name);
}
}
}