summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--urpm/media.pm8
2 files changed, 8 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index b31a5132..acfe53a7 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,9 @@
- urpmi.addmedia, urpmi.update:
o correctly handle media with no xml-info when using "xml-info: always"
(#39521)
+- urpmi.addmedia:
+ o --mirrorlist: if the retrieved media.cfg is broken, try another mirror
+ (#39591, it also workarounds #39592)
Version 5.17 - 28 March 2008, by Pascal "Pixel" Rigaux
diff --git a/urpm/media.pm b/urpm/media.pm
index 553edb19..1d49f8b0 100644
--- a/urpm/media.pm
+++ b/urpm/media.pm
@@ -773,15 +773,17 @@ sub add_distrib_media {
}
my $m = { mirrorlist => $options{mirrorlist}, url => $url };
+ my $parse_ok;
try__maybe_mirrorlist($urpm, $m, sub {
$distribconf = _new_distribconf_and_download($urpm, $m->{url});
+ $parse_ok = $distribconf && $distribconf->parse_mediacfg("$urpm->{cachedir}/partial/media.cfg");
+ $parse_ok;
});
$url = $m->{url};
if ($distribconf) {
- $distribconf->parse_mediacfg("$urpm->{cachedir}/partial/media.cfg")
- or $urpm->{error}(N("unable to parse media.cfg")), return();
- } else {
+ $parse_ok or $urpm->{error}(N("unable to parse media.cfg")), return();
+ } else {
$urpm->{error}(N("...retrieving failed: %s", $@));
$urpm->{error}(N("unable to access the distribution medium (no media.cfg file found)"));
return ();