summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2004-08-24 03:17:54 +0000
committerOlivier Blin <oblin@mandriva.org>2004-08-24 03:17:54 +0000
commit30046d189f18177dbdd16be8e47c7c15d4d2c785 (patch)
treef830587d830cf375f927b42460424836f4028fb7
parentd4235414f62923b8525ea0309aa5903cd8d43471 (diff)
downloaddrakx-30046d189f18177dbdd16be8e47c7c15d4d2c785.tar
drakx-30046d189f18177dbdd16be8e47c7c15d4d2c785.tar.gz
drakx-30046d189f18177dbdd16be8e47c7c15d4d2c785.tar.bz2
drakx-30046d189f18177dbdd16be8e47c7c15d4d2c785.tar.xz
drakx-30046d189f18177dbdd16be8e47c7c15d4d2c785.zip
really parse modules file according to its type when reading it (always call $conf->read, split modules::any_conf::read in modules::any_conf::read_handled)
-rw-r--r--perl-install/modules/any_conf.pm28
-rw-r--r--perl-install/modules/modprobe_conf.pm2
-rw-r--r--perl-install/modules/modules_conf.pm2
3 files changed, 19 insertions, 13 deletions
diff --git a/perl-install/modules/any_conf.pm b/perl-install/modules/any_conf.pm
index 0af11a461..28e22bf9b 100644
--- a/perl-install/modules/any_conf.pm
+++ b/perl-install/modules/any_conf.pm
@@ -125,17 +125,7 @@ sub read {
my (undef, $o_file) = @_;
my $conf = modules::any_conf::vnew();
- my $raw_conf = modules::any_conf::read_raw($o_file || $::prefix . $conf->file);
-
- foreach my $module (keys %$raw_conf) {
- my $raw = $raw_conf->{$module};
- my $keep = $conf->{$module} = {};
- foreach ($conf->handled_fields) {
- $keep->{$_} = $raw->{$_} if $raw->{$_};
- }
- }
-
- $conf;
+ $conf->read($o_file);
}
sub write {
@@ -178,6 +168,22 @@ sub write {
################################################################################
+sub read_handled {
+ my ($conf, $o_file) = @_;
+ my $file = $o_file || $::prefix . $conf->file;
+ my $raw_conf = modules::any_conf::read_raw($file);
+
+ foreach my $module (keys %$raw_conf) {
+ my $raw = $raw_conf->{$module};
+ my $keep = $conf->{$module} = {};
+ foreach ($conf->handled_fields) {
+ $keep->{$_} = $raw->{$_} if $raw->{$_};
+ }
+ }
+
+ $conf;
+}
+
sub read_raw {
my ($file) = @_;
my %c;
diff --git a/perl-install/modules/modprobe_conf.pm b/perl-install/modules/modprobe_conf.pm
index 2db68122d..2917e27be 100644
--- a/perl-install/modules/modprobe_conf.pm
+++ b/perl-install/modules/modprobe_conf.pm
@@ -54,7 +54,7 @@ sub read {
$f;
};
- my $conf = modules::any_conf::read($type, $file);
+ my $conf = modules::any_conf::read_handled($type, $file);
extract_probeall_field($conf);
diff --git a/perl-install/modules/modules_conf.pm b/perl-install/modules/modules_conf.pm
index 476fd300f..ed310c2d4 100644
--- a/perl-install/modules/modules_conf.pm
+++ b/perl-install/modules/modules_conf.pm
@@ -36,7 +36,7 @@ sub set_above {
sub read {
my ($type, $o_file) = @_;
- my $conf = modules::any_conf::read($type, $o_file);
+ my $conf = modules::any_conf::read_handled($type, $o_file);
#- convert old aliases to new probeall
foreach my $name ('scsi_hostadapter', 'usb-interface') {