summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS4
-rw-r--r--urpm/ldap.pm4
-rw-r--r--urpm/media.pm10
-rwxr-xr-xurpmi2
-rwxr-xr-xurpmi.addmedia2
-rwxr-xr-xurpmi.removemedia2
-rwxr-xr-xurpmi.update2
7 files changed, 15 insertions, 11 deletions
diff --git a/NEWS b/NEWS
index 8de11bde..d03f7576 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+- urpmi.update, urpmi.addmedia, urpmi.removemedia:
+ o do not check wether the media are valid,
+ it allows "mv /etc/urpmi/urpmi.cfg.{backup,} ; urpmi.update -a" to work
+ (nb: not equivalent with urpmi.addmedia, since pubkey will not be imported)
- aria2:
o do not use --max-file-not-found=3 when downloading rpms
(since rpms are "versioned")
diff --git a/urpm/ldap.pm b/urpm/ldap.pm
index 9a997fef..a2ab1e56 100644
--- a/urpm/ldap.pm
+++ b/urpm/ldap.pm
@@ -103,7 +103,7 @@ sub read_ldap_cache {
! -f $_ and next;
my %medium = get_vars_from_sh($_);
next if !check_ldap_medium(\%medium);
- urpm::media::add_existing_medium($urpm, \%medium);
+ urpm::media::add_existing_medium($urpm, \%medium, 'nocheck');
}
}
@@ -204,7 +204,7 @@ sub load_ldap_media {
$medium->{name} = "ldap_" . $medium->{name};
$medium->{ldap} = 1;
next if !check_ldap_medium($medium);
- urpm::media::add_existing_medium($urpm, $medium);
+ urpm::media::add_existing_medium($urpm, $medium, 'nocheck');
write_ldap_cache($urpm,$medium);
}
};
diff --git a/urpm/media.pm b/urpm/media.pm
index c8c3428b..e0e3ca5a 100644
--- a/urpm/media.pm
+++ b/urpm/media.pm
@@ -155,7 +155,7 @@ sub recover_url_from_list {
#- Loads /etc/urpmi/urpmi.cfg and performs basic checks.
#- Does not handle old format: <name> <url> [with <path_hdlist>]
sub read_config {
- my ($urpm) = @_;
+ my ($urpm, $nocheck) = @_;
return if $urpm->{media}; #- media already loaded
$urpm->{media} = [];
my $config = urpm::cfg::load_config($urpm->{config})
@@ -189,7 +189,7 @@ sub read_config {
}
}
- add_existing_medium($urpm, $_) foreach @media;
+ add_existing_medium($urpm, $_, $nocheck) foreach @media;
eval { require urpm::ldap; urpm::ldap::load_ldap_media($urpm) };
}
@@ -234,7 +234,7 @@ sub _migrate__with_synthesis {
#- probe medium to be used, take old medium into account too.
sub add_existing_medium {
- my ($urpm, $medium) = @_;
+ my ($urpm, $medium, $nocheck) = @_;
if (name2medium($urpm, $medium->{name})) {
$urpm->{error}(N("trying to override existing medium \"%s\", skipping", $medium->{name}));
@@ -246,7 +246,7 @@ sub add_existing_medium {
$urpm->{modified} = 1;
}
- check_existing_medium($urpm, $medium);
+ check_existing_medium($urpm, $medium) if !$nocheck;
_migrate_removable_device($urpm, $medium);
@@ -586,7 +586,7 @@ sub configure {
$urpm->{media} = [];
add_distrib_media($urpm, "Virtual", $options{usedistrib}, %options, virtual => 1, on_the_fly => 1);
} else {
- read_config($urpm);
+ read_config($urpm, '');
if (!$options{media} && $urpm->{options}{'default-media'}) {
$options{media} = $urpm->{options}{'default-media'};
}
diff --git a/urpmi b/urpmi
index d608ce70..2205f259 100755
--- a/urpmi
+++ b/urpmi
@@ -347,7 +347,7 @@ if ($urpm->{root}) {
if ($auto_update && !$bug && !$env) {
#- For translators : there are several media here
$urpm->{log}(N("Updating media...\n"));
- urpm::media::read_config($urpm);
+ urpm::media::read_config($urpm, '');
urpm::media::update_media($urpm,
all => 1,
callback => \&urpm::download::sync_logger,
diff --git a/urpmi.addmedia b/urpmi.addmedia
index 0c6c9d48..90c38a5e 100755
--- a/urpmi.addmedia
+++ b/urpmi.addmedia
@@ -128,7 +128,7 @@ if (!-e $urpm->{config}) {
open my $_f, '>', $urpm->{config} or $urpm->{fatal}(6, N("Can't create config file [%s]", $urpm->{config}));
}
my $_urpmi_lock = urpm::lock::urpmi_db($urpm, 'exclusive', wait => $options{wait_lock});
-urpm::media::read_config($urpm);
+urpm::media::read_config($urpm, 'nocheck');
my $ok = 1;
if ($options{distrib}) {
diff --git a/urpmi.removemedia b/urpmi.removemedia
index 247030ee..f885db02 100755
--- a/urpmi.removemedia
+++ b/urpmi.removemedia
@@ -60,7 +60,7 @@ if ($< != 0) {
}
my $_urpmi_lock = urpm::lock::urpmi_db($urpm, 'exclusive', wait => $options{wait_lock});
-urpm::media::read_config($urpm);
+urpm::media::read_config($urpm, 'nocheck');
urpm::download::set_cmdline_proxy();
my @entries = map { $_->{name} } @{$urpm->{media}};
diff --git a/urpmi.update b/urpmi.update
index b27f7fba..7698d324 100755
--- a/urpmi.update
+++ b/urpmi.update
@@ -69,7 +69,7 @@ if ($< != 0) {
$urpm->{fatal}(1, N("Only superuser is allowed to update media"));
}
my $_urpmi_lock = urpm::lock::urpmi_db($urpm, 'exclusive', wait => $options{wait_lock});
-urpm::media::read_config($urpm);
+urpm::media::read_config($urpm, 'nocheck');
my @chosen_media;