diff options
Diffstat (limited to 'perl-install/modules/any_conf.pm')
-rw-r--r-- | perl-install/modules/any_conf.pm | 28 |
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; |