diff options
author | Jonas Bjurel <jonas.bjurel@ericsson.com> | 2016-09-30 20:28:22 +0200 |
---|---|---|
committer | Jonas Bjurel <jonas.bjurel@ericsson.com> | 2016-09-30 20:43:13 +0200 |
commit | af2db33a0ebab98700c3c03ea84a6ba9b987c5b5 (patch) | |
tree | 0b789b555d1d62af4e80aea8d802998a32573ad3 /build/f_isoroot/f_repobuild/select_ubuntu_repo.sh | |
parent | 095442c4bdf437531eae2aecd364e74d756757fd (diff) |
Preparing the experimental branch for improved Danube CI/CD experimentsexperimental
Fast forwarded to commit:cf93e6ee11c96de090b04196cc96b4a6b0948928
Change-Id: I13d10d870e8ffc7317ab03f8810592d5b2205875
Signed-off-by: Jonas Bjurel <jonas.bjurel@ericsson.com>
Diffstat (limited to 'build/f_isoroot/f_repobuild/select_ubuntu_repo.sh')
-rwxr-xr-x | build/f_isoroot/f_repobuild/select_ubuntu_repo.sh | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/build/f_isoroot/f_repobuild/select_ubuntu_repo.sh b/build/f_isoroot/f_repobuild/select_ubuntu_repo.sh new file mode 100755 index 000000000..20b3485a1 --- /dev/null +++ b/build/f_isoroot/f_repobuild/select_ubuntu_repo.sh @@ -0,0 +1,40 @@ +#!/bin/bash +############################################################################## +# Copyright (c) 2015,2016 Ericsson AB and others. +# mskalski@mirantis.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +# 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="mirror.clibre.uqam.ca" + +#NOTE: For now the mirror selection is disabled due to issues not yet +# understood/resolved. +#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 +# if curl -s -o /dev/null --head --fail "$url"; then +# echo $url +# exit 0 +# else +# continue +# fi +#done + +# If no suitable local mirror can be found, +# the default archive is returned instead. +echo "http://archive.ubuntu.com/ubuntu/" |