diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-03-31 09:32:07 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-03-31 09:32:07 +0000 |
commit | b1c3e60766f05f8adec70fb1c4c920e5bae395b0 (patch) | |
tree | 864c314a7e96e0abebb1d2e2ea4c58dc5d44cbe0 /urpm/media.pm | |
parent | 06aed9d8492765d14ee2a9972aba749547cd1671 (diff) | |
download | urpmi-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)
Diffstat (limited to 'urpm/media.pm')
-rw-r--r-- | urpm/media.pm | 8 |
1 files changed, 5 insertions, 3 deletions
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 (); |