summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--urpm/download.pm15
2 files changed, 15 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 31c0509d..a423cca8 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+- all tools
+ o use metalink/aria2 by default (when available) when using a mirrorlist
- urpmi, urpmq
o do not display all substring matches on stderr, only a subset of them, and
suggest to use "-a" to use all matches (#38956)
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];