summaryrefslogtreecommitdiffstats
path: root/urpm/download.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-09-05 09:51:42 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-09-05 09:51:42 +0000
commitace1dd46f635ae7de6508fb88d19e2b4e0718476 (patch)
treee05e7a966126dfc5ea702bd1f50c912fea5c4fcb /urpm/download.pm
parented6f4ec4c4b047e64ee040ff806a2d2eab076c5f (diff)
downloadurpmi-ace1dd46f635ae7de6508fb88d19e2b4e0718476.tar
urpmi-ace1dd46f635ae7de6508fb88d19e2b4e0718476.tar.gz
urpmi-ace1dd46f635ae7de6508fb88d19e2b4e0718476.tar.bz2
urpmi-ace1dd46f635ae7de6508fb88d19e2b4e0718476.tar.xz
urpmi-ace1dd46f635ae7de6508fb88d19e2b4e0718476.zip
- fix handling --downloader when using mirrorlist (it was forcing aria2)
Diffstat (limited to 'urpm/download.pm')
-rw-r--r--urpm/download.pm19
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}) {