summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-09-23 12:10:01 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-09-23 12:10:01 +0000
commit522e8aaf3e22382d50d7a6a1fcc488c4dba7ec43 (patch)
treede36e68019b0f5c98693bf127304735305ad60b2 /urpm
parente93d54f244ef8420b1c6314177c4bb339ad35f73 (diff)
downloadurpmi-522e8aaf3e22382d50d7a6a1fcc488c4dba7ec43.tar
urpmi-522e8aaf3e22382d50d7a6a1fcc488c4dba7ec43.tar.gz
urpmi-522e8aaf3e22382d50d7a6a1fcc488c4dba7ec43.tar.bz2
urpmi-522e8aaf3e22382d50d7a6a1fcc488c4dba7ec43.tar.xz
urpmi-522e8aaf3e22382d50d7a6a1fcc488c4dba7ec43.zip
{allow_metalink} was used unitialised, so now always using use_metalink() and
doing the memoizing inside use_metalink()
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');