summaryrefslogtreecommitdiffstats
path: root/urpm/media.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/media.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/media.pm')
-rw-r--r--urpm/media.pm35
1 files changed, 3 insertions, 32 deletions
diff --git a/urpm/media.pm b/urpm/media.pm
index 90f32583..4733c014 100644
--- a/urpm/media.pm
+++ b/urpm/media.pm
@@ -165,7 +165,6 @@ sub read_config {
#- per-media options
read_config_add_passwords($urpm, $config);
- my @media;
foreach my $m (@{$config->{media}}) {
my $medium = _only_media_opts_read($m);
@@ -179,17 +178,6 @@ sub read_config {
push @media, $medium;
}
- require File::Glob;
- # we can't use perl's glob() because we allow spaces in filename
- foreach my $conf_file (File::Glob::bsd_glob("$urpm->{configs_dir}/*.cfg")) {
- $urpm->{debug} and $urpm->{debug}("parsing: $conf_file");
- my $conf = urpm::cfg::load_ini_config_file_raw($conf_file);
- foreach my $medium (map { _only_media_opts_read($_) } @$conf) {
- $medium->{conf_file} = $conf_file;
- push @media, $medium;
- }
- }
-
add_existing_medium($urpm, $_, $nocheck) foreach @media;
eval { require urpm::ldap; urpm::ldap::load_ldap_media($urpm) };
@@ -207,12 +195,7 @@ sub check_existing_medium {
N("unable to access list file of \"%s\", medium ignored", $medium->{name});
} elsif (!$medium->{ignore}
&& !-r any_synthesis($urpm, $medium)) {
- if ($medium->{conf_file} && $< == 0) {
- # no pb, we create on the fly
- $medium->{force_auto_update} = 1;
- } else {
- $err = N("unable to access synthesis file of \"%s\", medium ignored", $medium->{name});
- }
+ $err = N("unable to access synthesis file of \"%s\", medium ignored", $medium->{name});
}
if ($err) {
$medium->{ignore} = 1;
@@ -481,16 +464,11 @@ sub write_urpmi_cfg {
#- avoid trashing exiting configuration if it wasn't loaded
$urpm->{media} or return;
- my %media_per_cfg;
- foreach (grep { !$_->{external} } @{$urpm->{media}}) {
- push @{$media_per_cfg{$_->{conf_file} || ''}}, _only_media_opts_write($_);
- }
-
my $config = {
#- global config options found in the config file, without the ones
#- set from the command-line
global => $urpm->{global_config},
- media => delete $media_per_cfg{''},
+ media => [ map { _only_media_opts_write($_) } grep { !$_->{external} } @{$urpm->{media}} ],
};
remove_passwords_and_write_private_netrc($urpm, $config);
@@ -499,13 +477,6 @@ sub write_urpmi_cfg {
$urpm->{log}(N("wrote config file [%s]", $urpm->{config}));
- foreach my $conf_file (sort keys %media_per_cfg) {
- urpm::cfg::write_ini_config($conf_file, $media_per_cfg{$conf_file})
- or $urpm->{fatal}(6, N("unable to write config file [%s]", $conf_file));
-
- $urpm->{log}(N("wrote config file [%s]", $conf_file));
- }
-
#- everything should be synced now.
delete $urpm->{modified};
}
@@ -641,7 +612,7 @@ sub _auto_update_media {
$options{callback} = delete $options{download_callback};
- foreach (grep { $_->{force_auto_update} || _is_remote_virtual($_) || $urpm->{options}{'auto-update'} }
+ foreach (grep { _is_remote_virtual($_) || $urpm->{options}{'auto-update'} }
non_ignored_media($urpm, $options{update})) {
_update_medium($urpm, $_, %options);
}