summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-03-31 09:32:07 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-03-31 09:32:07 +0000
commitb1c3e60766f05f8adec70fb1c4c920e5bae395b0 (patch)
tree864c314a7e96e0abebb1d2e2ea4c58dc5d44cbe0
parent06aed9d8492765d14ee2a9972aba749547cd1671 (diff)
downloadurpmi-b1c3e60766f05f8adec70fb1c4c920e5bae395b0.tar
urpmi-b1c3e60766f05f8adec70fb1c4c920e5bae395b0.tar.gz
urpmi-b1c3e60766f05f8adec70fb1c4c920e5bae395b0.tar.bz2
urpmi-b1c3e60766f05f8adec70fb1c4c920e5bae395b0.tar.xz
urpmi-b1c3e60766f05f8adec70fb1c4c920e5bae395b0.zip
- urpmi.addmedia:
o --mirrorlist: if the retrieved media.cfg is broken, try another mirror (#39591, it also workarounds #39592)
-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 ();