summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-10-14 13:44:33 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-10-14 13:44:33 +0000
commitd6a209622740f7568bb80bce826d3ec34bdf3954 (patch)
treef22597674b358df140a1224b21b1d166b595662e /urpm
parent54ed4e4161c0838da939057e5b286e93f2423dfb (diff)
downloadurpmi-d6a209622740f7568bb80bce826d3ec34bdf3954.tar
urpmi-d6a209622740f7568bb80bce826d3ec34bdf3954.tar.gz
urpmi-d6a209622740f7568bb80bce826d3ec34bdf3954.tar.bz2
urpmi-d6a209622740f7568bb80bce826d3ec34bdf3954.tar.xz
urpmi-d6a209622740f7568bb80bce826d3ec34bdf3954.zip
- 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)
Diffstat (limited to 'urpm')
-rw-r--r--urpm/ldap.pm4
-rw-r--r--urpm/media.pm10
2 files changed, 7 insertions, 7 deletions
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'};
}