diff options
-rw-r--r-- | urpm/download.pm | 9 | ||||
-rw-r--r-- | urpm/media.pm | 4 |
2 files changed, 10 insertions, 3 deletions
diff --git a/urpm/download.pm b/urpm/download.pm index a8b24379..c1b07820 100644 --- a/urpm/download.pm +++ b/urpm/download.pm @@ -48,6 +48,13 @@ sub available_metalink_downloaders() { grep { -x "/usr/bin/$binaries{$_}" || -x "/bin/$binaries{$_}" } metalink_downloaders(); } +sub use_metalink { + my ($urpm, $medium) = @_; + my $use_metalink = 1; + preferred_downloader($urpm, $medium, \$use_metalink); + $use_metalink; +} + my %warned; sub preferred_downloader { my ($urpm, $medium, $use_metalink) = @_; @@ -813,7 +820,7 @@ sub sync_rel { my @files = map { reduce_pathname("$medium->{url}/$_") } @$rel_files; - my $files_text = join(' ', ($medium->{mirrorlist} && $urpm->{allow_metalink} ? ($medium->{mirrorlist}, $medium->{'with-dir'}) : url_obscuring_password($medium->{url})), @$rel_files); + my $files_text = join(' ', ($medium->{allow_metalink} ? ($medium->{mirrorlist}, $medium->{'with-dir'}) : url_obscuring_password($medium->{url})), @$rel_files); $urpm->{debug} and $urpm->{debug}(N("retrieving %s", $files_text)); eval { diff --git a/urpm/media.pm b/urpm/media.pm index cec08f52..3149f92c 100644 --- a/urpm/media.pm +++ b/urpm/media.pm @@ -1797,8 +1797,8 @@ sub try__maybe_mirrorlist { my ($urpm, $medium, $try) = @_; if ($medium->{mirrorlist}) { - $urpm->{allow_metalink} //= urpm::download::available_metalink_downloaders(); - if ($urpm->{allow_metalink}) { + $medium->{allow_metalink} //= urpm::download::use_metalink($urpm, $medium); + if ($medium->{allow_metalink}) { #- help things... _pick_mirror_if_needed($urpm, $medium, 'allow-cache-update'); |