summaryrefslogtreecommitdiffstats
path: root/urpm/download.pm
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/download.pm
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/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);