summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
Diffstat (limited to 'urpm')
-rw-r--r--urpm/download.pm11
-rw-r--r--urpm/media.pm3
2 files changed, 8 insertions, 6 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);
diff --git a/urpm/media.pm b/urpm/media.pm
index 48bc6392..aea565ef 100644
--- a/urpm/media.pm
+++ b/urpm/media.pm
@@ -1759,8 +1759,7 @@ sub try__maybe_mirrorlist {
my ($urpm, $medium, $is_a_probe, $try) = @_;
if ($medium->{mirrorlist}) {
- $medium->{allow_metalink} //= urpm::download::use_metalink($urpm, $medium);
- if ($medium->{allow_metalink}) {
+ if (urpm::download::use_metalink($urpm, $medium)) {
#- help things...
_pick_mirror_if_needed($urpm, $medium, 'allow-cache-update');