summaryrefslogtreecommitdiffstats
path: root/urpm/cfg.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2009-01-28 13:59:18 +0000
committerPascal Rigaux <pixel@mandriva.com>2009-01-28 13:59:18 +0000
commitb0740bb0a7329249cb0372fe589709b8c8abda6f (patch)
tree08a85bf4092514021d3d6c9cb72f0e4055d7eded /urpm/cfg.pm
parent2c647329d1253cabcfe7628376370cb13c311a2e (diff)
downloadurpmi-b0740bb0a7329249cb0372fe589709b8c8abda6f.tar
urpmi-b0740bb0a7329249cb0372fe589709b8c8abda6f.tar.gz
urpmi-b0740bb0a7329249cb0372fe589709b8c8abda6f.tar.bz2
urpmi-b0740bb0a7329249cb0372fe589709b8c8abda6f.tar.xz
urpmi-b0740bb0a7329249cb0372fe589709b8c8abda6f.zip
- drop support for /etc/urpmi/media.d/*.cfg
(was partially broken, non documented and hopefully unused) (mostly reverting commit 234656 which introduced that feature)
Diffstat (limited to 'urpm/cfg.pm')
-rw-r--r--urpm/cfg.pm64
1 files changed, 0 insertions, 64 deletions
diff --git a/urpm/cfg.pm b/urpm/cfg.pm
index 8619eda9..149d41fc 100644
--- a/urpm/cfg.pm
+++ b/urpm/cfg.pm
@@ -255,70 +255,6 @@ sub dump_config_raw {
1;
}
-sub load_ini_config_file_raw {
- my ($file, $b_norewrite) = @_;
-
- require Config::IniFiles;
- my $cfg = Config::IniFiles->new('-file' => $file) or return [];
-
- [ map {
- my $section = $_;
- my %h = map {
- my $v = $cfg->val($section, $_);
- $v = expand_line($v) if !$b_norewrite;
- $_ => $v;
- } $cfg->Parameters($section);
- { 'with-dir' => $section, %h };
- } $cfg->Sections ];
-}
-
-sub write_ini_config {
- my ($file, $blocks) = @_;
-
- if (@$blocks == 0) {
- unlink $file;
- return;
- }
- my $modified;
-
- require Config::IniFiles;
- my $cfg = Config::IniFiles->new('-file' => $file);
- if ($cfg) {
- # remove dropped blocks
- foreach (difference2([ $cfg->Sections ], [ map { $_->{name} } @$blocks ])) {
- $cfg->DeleteSection($_);
- $modified = 1;
- }
- } else {
- $cfg = Config::IniFiles->new;
- }
-
- my %uniq;
-
- foreach (@$blocks) {
- my %h = %$_;
- my $section = delete $h{'with-dir'} || '_';
- $uniq{$section}++ or die "conflicting with-dir value $section\n";
-
- foreach (difference2([ $cfg->Parameters($section) ], [ keys %h ])) {
- # remove those options which are no more wanted
- $cfg->delval($section, $_);
- $modified = 1;
- }
- foreach (keys %h) {
- my $old_v = $cfg->getval($section, $_);
- my $v = substitute_back($h{$_}, $old_v);
- if ($old_v ne $v) {
- $cfg->setval($section, $_, $v);
- $modified = 1;
- }
- }
- }
- if ($modified) {
- $cfg->RewriteConfig;
- }
-}
-
1;
__END__