summaryrefslogtreecommitdiffstats
path: root/perl-install/modules/any_conf.pm
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 /perl-install/modules/any_conf.pm
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)
Diffstat (limited to 'perl-install/modules/any_conf.pm')
-rw-r--r--perl-install/modules/any_conf.pm28
1 files changed, 17 insertions, 11 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;