summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2022-11-30 14:59:58 +0000
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2022-11-30 14:59:58 +0000
commit5bb6246346447a3b9d5e77b572e91809e4b90d7a (patch)
treedf9c8081b1312e881140b533f7d617ea144b1a3d
parent3c568d7d1f55c44030329c816567c7daecdd1c9d (diff)
downloaddrakx-5bb6246346447a3b9d5e77b572e91809e4b90d7a.tar
drakx-5bb6246346447a3b9d5e77b572e91809e4b90d7a.tar.gz
drakx-5bb6246346447a3b9d5e77b572e91809e4b90d7a.tar.bz2
drakx-5bb6246346447a3b9d5e77b572e91809e4b90d7a.tar.xz
drakx-5bb6246346447a3b9d5e77b572e91809e4b90d7a.zip
Use urpm::mirrors::add_proximity_and_sort() in place of mirror::nearest().
-rw-r--r--perl-install/any.pm12
1 files changed, 9 insertions, 3 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index e49c9ddff..9ffe0a86d 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -1906,10 +1906,16 @@ sub ask_mirror {
my $give_url = { country => '-', host => 'URL' };
- my $mirror = $o_url ? (find { $_->{url} eq $o_url } @$mirrors) || $give_url
+ my $mirror;
+ if ($o_url) {
+ $mirror = (find { $_->{url} eq $o_url } @$mirrors) || $give_url;
+ } else {
#- use current time zone to select best mirror
- : mirror::nearest($in->{timezone}{timezone}, $mirrors) || $give_url;
-
+ require urpm::mirrors;
+ my $urpm = $in->{packages} || { log => \&log::l };
+ urpm::mirrors::add_proximity_and_sort($urpm, $mirrors);
+ $mirror = @$mirrors[0] || $give_url;
+ }
$in->ask_from_({ messages => N("Choose a mirror from which to get the packages"),
cancel => N("Cancel"),
}, [ { separator => '|',