summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS1
-rw-r--r--urpm/download.pm19
2 files changed, 13 insertions, 7 deletions
diff --git a/NEWS b/NEWS
index 9ea7da5f..18bc0e3b 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,5 @@
- fix display of downloaded urls with aria2 and metalinks
+- fix handling --downloader when using mirrorlist (it was forcing aria2)
Version 6.8 - 4 September 2008, Pascal "Pixel" Rigaux
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}) {