diff options
Diffstat (limited to 'urpm')
-rw-r--r-- | urpm/download.pm | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/urpm/download.pm b/urpm/download.pm index e8de9f2b..2a46bb74 100644 --- a/urpm/download.pm +++ b/urpm/download.pm @@ -838,21 +838,19 @@ sub _sync_webfetch_raw { } elsif (member($proto, 'ftp', 'http', 'https')) { my @available = urpm::download::available_ftp_http_downloaders(); + my @metalink_downloaders; if ($options->{metalink}) { #- If metalink is used, only aria2 is available as other downloaders doesn't support metalink - if (my @l = urpm::download::available_metalink_downloaders()) { - @available = @l; - } else { - $urpm->{log}("not using metalink since no downloaders handling metalink are available"); - delete $options->{metalink}; - } + @metalink_downloaders = urpm::download::available_metalink_downloaders(); + unshift @available, @metalink_downloaders; } #- first downloader of @available is the default one my $preferred = $available[0]; - if (my $requested_downloader = requested_ftp_http_downloader($urpm, $medium)) { + my $requested_downloader = requested_ftp_http_downloader($urpm, $medium); + if ($requested_downloader) { if (grep { $_ eq $requested_downloader } @available) { #- use user default downloader if provided and available $preferred = $requested_downloader; @@ -861,6 +859,13 @@ sub _sync_webfetch_raw { $webfetch_not_available = 1; } } + if (!member($preferred, @metalink_downloaders)) { + $urpm->{log}($requested_downloader eq $preferred ? + "not using metalink since requested downloader does not handle it" : + "not using metalink since no downloaders handling metalink are available"); + delete $options->{metalink}; + } + my $sync = $urpm::download::{"sync_$preferred"} or die N("no webfetch found, supported webfetch are: %s\n", join(", ", urpm::download::ftp_http_downloaders())); if ($options->{metalink}) { |