diff options
-rw-r--r-- | perl-install/any.pm | 12 |
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 => '|', |