summaryrefslogtreecommitdiffstats
path: root/urpm/download.pm
diff options
context:
space:
mode:
Diffstat (limited to 'urpm/download.pm')
-rw-r--r--urpm/download.pm11
1 files changed, 7 insertions, 4 deletions
diff --git a/urpm/download.pm b/urpm/download.pm
index 18448981..3ded06d6 100644
--- a/urpm/download.pm
+++ b/urpm/download.pm
@@ -50,9 +50,12 @@ sub available_metalink_downloaders() {
sub use_metalink {
my ($urpm, $medium) = @_;
- my $use_metalink = 1;
- preferred_downloader($urpm, $medium, \$use_metalink);
- $use_metalink;
+
+ $medium->{allow_metalink} //= do {
+ my $use_metalink = 1;
+ preferred_downloader($urpm, $medium, \$use_metalink);
+ $use_metalink;
+ };
}
my %warned;
@@ -820,7 +823,7 @@ sub sync_rel {
my @files = map { reduce_pathname("$medium->{url}/$_") } @$rel_files;
- my $files_text = join(' ', ($medium->{allow_metalink} ? ($medium->{mirrorlist}, $medium->{'with-dir'}) : url_obscuring_password($medium->{url})), @$rel_files);
+ my $files_text = join(' ', (use_metalink($urpm, $medium) ? ($medium->{mirrorlist}, $medium->{'with-dir'}) : url_obscuring_password($medium->{url})), @$rel_files);
$urpm->{debug} and $urpm->{debug}(N("retrieving %s", $files_text));
my $all_options = _all_options($urpm, $medium, \%options);