summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan K. Berg <stefan.k.berg@ericsson.com>2016-09-19 14:14:23 +0200
committerStefan Berg <stefan.k.berg@ericsson.com>2016-09-19 15:35:44 +0000
commit3618bd69b8fc88b45330dff2a698e5303602622e (patch)
treeb168e378097a28b3bb7d793b9d236b6f48a8d5f6
parentf9326c161e2e8ed039499d30cced7c2553874e26 (diff)
Make sure to use only up-to-date mirrors
Whitewash the geographically "close" mirrors against the list of fully synced mirrors - we've had a few instances of getting bad mirrors which would break the script. All credit goes to: https://askubuntu.com/questions/39922/how-do-you-select-the-fastest-mirror-from-the-command-line ... and we should perhaps use the netselect tool as well somewhere down the line, but this fixes the most urgent problem. Change-Id: Ia61a2bd78657b28019f57fc1962d410e754e6d2a Signed-off-by: Stefan K. Berg <stefan.k.berg@ericsson.com> (cherry picked from commit e12aec84ef1767d4ba9469dfb12d65d928bf0ed4)
-rwxr-xr-xbuild/f_isoroot/f_repobuild/select_ubuntu_repo.sh12
1 files changed, 9 insertions, 3 deletions
diff --git a/build/f_isoroot/f_repobuild/select_ubuntu_repo.sh b/build/f_isoroot/f_repobuild/select_ubuntu_repo.sh
index 7b134e73c..c3bb5cf36 100755
--- a/build/f_isoroot/f_repobuild/select_ubuntu_repo.sh
+++ b/build/f_isoroot/f_repobuild/select_ubuntu_repo.sh
@@ -8,14 +8,20 @@
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
-# Try to choose close ubuntu mirror
+# Try to choose close ubuntu mirror from mirrors.txt, but "whitewash" this
+# against the full repo list to removed mirrors not up-to-date.
# Some Ubuntu mirrors seem less reliable for this type of mirroring -
# as they are discoved they can be added to the blacklist below in order
# for them not to be considered.
-BLACKLIST="mirrors.se.eu.kernel.org mirror.its.dal.ca"
+BLACKLIST="mirror.clibre.uqam.ca"
-for url in $(curl -s http://mirrors.ubuntu.com/mirrors.txt)
+for url in $((curl -s https://launchpad.net/ubuntu/+archivemirrors | \
+ grep -P -B8 "statusUP|statusSIX" | \
+ grep -o -P "(f|ht)tp.*\"" | \
+ sed 's/"$//' | sort | uniq; \
+ curl -s http://mirrors.ubuntu.com/mirrors.txt | sort | uniq) | \
+ sort | uniq -d)
do
host=$(echo $url | cut -d'/' -f3)
echo ${BLACKLIST} | grep -q ${host} && continue