summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-09-01 16:15:20 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-09-01 16:15:20 +0000
commit5251c049bf76c31627b657e5c25b22c716533931 (patch)
treec464e9b09edde1f6ca16e52968ff0f14d1a06c05 /urpm
parentbf1ef92e9493db31da55338ff721a765a1379982 (diff)
downloadurpmi-5251c049bf76c31627b657e5c25b22c716533931.tar
urpmi-5251c049bf76c31627b657e5c25b22c716533931.tar.gz
urpmi-5251c049bf76c31627b657e5c25b22c716533931.tar.bz2
urpmi-5251c049bf76c31627b657e5c25b22c716533931.tar.xz
urpmi-5251c049bf76c31627b657e5c25b22c716533931.zip
- all tools
o use metalink/aria2 by default (when available) when using a mirrorlist
Diffstat (limited to 'urpm')
-rw-r--r--urpm/download.pm15
1 files changed, 13 insertions, 2 deletions
diff --git a/urpm/download.pm b/urpm/download.pm
index 2b309c83..c6a8381a 100644
--- a/urpm/download.pm
+++ b/urpm/download.pm
@@ -766,6 +766,7 @@ sub sync {
my %all_options = (
dir => "$urpm->{cachedir}/partial",
proxy => get_proxy_($urpm, $medium),
+ metalink => $medium->{mirrorlist},
$urpm->{debug} ? (debug => $urpm->{debug}) : (),
%options,
);
@@ -818,8 +819,18 @@ sub _sync_webfetch_raw {
}
if ($files{ftp} || $files{http} || $files{https}) {
- #- If metalink is used, only aria2 is available as other downloaders doesn't support metalink
- my @available = ($options->{metalink} ? urpm::download::available_metalink_downloaders() : urpm::download::available_ftp_http_downloaders());
+ my @available = urpm::download::available_ftp_http_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};
+ }
+ }
+
#- first downloader of @available is the default one
my $preferred = $available[0];