summaryrefslogtreecommitdiffstats
path: root/urpm/download.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-09-04 07:56:16 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-09-04 07:56:16 +0000
commit6ae3df8b164d3e77e30fd2b7dfc4edafab616380 (patch)
treed6f5eeadb502148b384fd1a96c8b3494bff940f9 /urpm/download.pm
parentb39c0519989af0611ae217b01c026e8e158b101a (diff)
downloadurpmi-6ae3df8b164d3e77e30fd2b7dfc4edafab616380.tar
urpmi-6ae3df8b164d3e77e30fd2b7dfc4edafab616380.tar.gz
urpmi-6ae3df8b164d3e77e30fd2b7dfc4edafab616380.tar.bz2
urpmi-6ae3df8b164d3e77e30fd2b7dfc4edafab616380.tar.xz
urpmi-6ae3df8b164d3e77e30fd2b7dfc4edafab616380.zip
create urpm::mirrors::list_urls() and use it
this fixes things like "mirrorlist: http://localmirror/dis/cooker/i586 $MIRRORLIST"
Diffstat (limited to 'urpm/download.pm')
-rw-r--r--urpm/download.pm7
1 files changed, 3 insertions, 4 deletions
diff --git a/urpm/download.pm b/urpm/download.pm
index 47e25a75..53e47467 100644
--- a/urpm/download.pm
+++ b/urpm/download.pm
@@ -925,7 +925,9 @@ sub _create_metalink_ {
# Don't create a metalink when downloading mirror list
$medium or return;
- my $mirrors = $urpm->{mirrors_cache}{$medium->{mirrorlist}};
+ # only use the 8 best mirrors, then we let aria2 choose
+ require urpm::mirrors;
+ my @mirrors = map { _take_n_elem(8, @$_) } urpm::mirrors::list_urls($urpm, $medium, '');
my $metalinkfile = "$urpm->{cachedir}/$options->{media}.metalink";
# Even if not required by metalink spec, this line is needed at top of
@@ -936,9 +938,6 @@ sub _create_metalink_ {
'<files>',
);
- # only use the 8 best mirrors, then we let aria2 choose
- my @mirrors = _take_n_elem(8, @{$mirrors->{list}});
-
foreach my $rel_file (@$rel_files) {
my $i = 0;
my @lines = map {