summaryrefslogtreecommitdiffstats
path: root/urpm/mirrors.pm
diff options
context:
space:
mode:
Diffstat (limited to 'urpm/mirrors.pm')
-rw-r--r--urpm/mirrors.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/urpm/mirrors.pm b/urpm/mirrors.pm
index 295c92c6..888c411e 100644
--- a/urpm/mirrors.pm
+++ b/urpm/mirrors.pm
@@ -276,7 +276,9 @@ sub add_proximity_and_sort {
$_->{proximity_corrected} *= _between_country_correction($country_code, $_->{country}) if $best;
$_->{proximity_corrected} *= _between_continent_correction($best->{continent}, $_->{continent}) if $best;
}
- @$mirrors = sort { $a->{proximity_corrected} <=> $b->{proximity_corrected} } @$mirrors;
+ # prefer http mirrors by sorting them to the beginning
+ @$mirrors = sort { ($b->{url} =~ m!^http://!) <=> ($a->{url} =~ m!^http://!)
+ || $a->{proximity_corrected} <=> $b->{proximity_corrected} } @$mirrors;
}
# add +/- 5% random