From a5d3cbbe2c395af111ca97b6391872860feabc81 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sun, 12 Jun 2016 11:32:37 +0200 Subject: [PATCH] Add option to use mirror status Using the mirror status when updating mirrors ranks them in order of best synchronized to worst. --- update-mirrors | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/update-mirrors b/update-mirrors index 0f42b01..62d0ae1 100755 --- a/update-mirrors +++ b/update-mirrors @@ -5,6 +5,7 @@ url="https://www.archlinux.org/mirrorlist" countries=("BE" "NL") protocols=("http" "https") ip_versions=(4) +use_mirror_status="on" dest="/etc/pacman.d/mirrorlist" # Functions @@ -30,8 +31,9 @@ function make-url () local countryparams=$(urlify country ${countries[@]}) local protocolparams=$(urlify protocol ${protocols[@]}) local ipparams=$(urlify ip_version ${ip_versions[@]}) + local statusparams=$(urlify use_mirror_status $use_mirror_status) - echo "${url}/?${countryparams}&${protocolparams}&${ipparams}" + echo "${url}/?${countryparams}&${protocolparams}&${ipparams}&${statusparams}" } # Load config file