From b1c3e60766f05f8adec70fb1c4c920e5bae395b0 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 31 Mar 2008 09:32:07 +0000 Subject: - urpmi.addmedia: o --mirrorlist: if the retrieved media.cfg is broken, try another mirror (#39591, it also workarounds #39592) --- urpm/media.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'urpm') 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 (); -- cgit v1.2.1