summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnssi Hannula <anssi@mageia.org>2015-12-31 06:41:57 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2016-07-11 11:05:02 +0200
commite3525e19bbc51a9180dd40be62f375aa7a186eb0 (patch)
treee1314a7df5f8cae2a6ba9bc19eb2b577a024aa37
parent243136c02999fb87dda04d2da9461253bd1fb782 (diff)
downloadurpmi-e3525e19bbc51a9180dd40be62f375aa7a186eb0.tar
urpmi-e3525e19bbc51a9180dd40be62f375aa7a186eb0.tar.gz
urpmi-e3525e19bbc51a9180dd40be62f375aa7a186eb0.tar.bz2
urpmi-e3525e19bbc51a9180dd40be62f375aa7a186eb0.tar.xz
urpmi-e3525e19bbc51a9180dd40be62f375aa7a186eb0.zip
Prefer http mirrors when using a mirrorlist
Sort http mirrors to the beginning of the mirror list. This avoids an rsync mirror being selected as the mirror sometimes, which causes the preferred aria2 downloader from not being used. This also has the effect that in practice aria2 will only be given http mirrors. If this causes issues, the sorting code can be changed to reverse sort with the presence of "rsync://" instead.
-rw-r--r--NEWS2
-rw-r--r--urpm/mirrors.pm4
2 files changed, 5 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index d268b39b..b4a9d3a2 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,8 @@
o fix using a proxy without an auth user (mga#11265)
- library:
o fix unmarking packages as potential orphans when downgrading (mga#16149)
+- prefer http mirrors when using a mirrorlist, this avoids selecting an rsync
+ mirror which prevents aria2 from being used
Version 8.06 - 18 May 2015
diff --git a/urpm/mirrors.pm b/urpm/mirrors.pm
index d44ef6da..349e6c3d 100644
--- a/urpm/mirrors.pm
+++ b/urpm/mirrors.pm
@@ -277,7 +277,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