From 30046d189f18177dbdd16be8e47c7c15d4d2c785 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Tue, 24 Aug 2004 03:17:54 +0000 Subject: 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) --- perl-install/modules/any_conf.pm | 28 +++++++++++++++++----------- perl-install/modules/modprobe_conf.pm | 2 +- perl-install/modules/modules_conf.pm | 2 +- 3 files changed, 19 insertions(+), 13 deletions(-) (limited to 'perl-install/modules') 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') { -- cgit v1.2.1