aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/install-qt.sh
diff options
context:
space:
mode:
authorRichard Weickelt <richard@weickelt.de>2021-01-20 18:25:49 +0100
committerRichard Weickelt <richard@weickelt.de>2021-01-21 10:03:32 +0000
commitca072e8f40c22b98c84be050be68edeb6a71eb6a (patch)
treefae2992c2e6488d9a8017b80c6ecc94428e033d8 /scripts/install-qt.sh
parentf7e98f94a7ca3e0decdc2eb5e5e3b90f3fc64480 (diff)
Make use of mirrors to download Qt
The list is just a random selection. Change-Id: I0835f93bf2b83eb16aa6daee54c40f34dcc58bb4 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Diffstat (limited to 'scripts/install-qt.sh')
-rwxr-xr-xscripts/install-qt.sh20
1 files changed, 18 insertions, 2 deletions
diff --git a/scripts/install-qt.sh b/scripts/install-qt.sh
index f85ea157a..649fdf21c 100755
--- a/scripts/install-qt.sh
+++ b/scripts/install-qt.sh
@@ -222,6 +222,22 @@ if ${INSTALLATION_IS_VALID}; then
exit 0
fi
+MIRRORS="\
+ http://download.qt.io \
+ http://ftp.acc.umu.se/mirror/qt.io/qtproject \
+ http://qt.mirrors.tds.net/qt \
+ http://ftp.fau.de/qtproject \
+"
+
+for MIRROR in ${MIRRORS}; do
+ if curl "${MIRROR}/online" -s -f -o /dev/null; then
+ break;
+ else
+ echo "Server ${MIRROR} not availabe. Trying next alternative..." >&2
+ MIRROR=""
+ fi
+done
+
DOWNLOAD_DIR=`mktemp -d 2>/dev/null || mktemp -d -t 'install-qt'`
#
@@ -230,13 +246,13 @@ DOWNLOAD_DIR=`mktemp -d 2>/dev/null || mktemp -d -t 'install-qt'`
function compute_url(){
local COMPONENT=$1
local CURL="curl -s -L"
- local BASE_URL="http://download.qt.io/online/qtsdkrepository/${HOST_OS}/${TARGET_PLATFORM}"
+ local BASE_URL="${MIRROR}/online/qtsdkrepository/${HOST_OS}/${TARGET_PLATFORM}"
local ANDROID_ARCH=$(echo ${TOOLCHAIN##android_})
if [[ "${COMPONENT}" =~ "qtcreator" ]]; then
SHORT_VERSION=${VERSION%??}
- BASE_URL="http://download.qt.io/official_releases/qtcreator"
+ BASE_URL="${MIRROR}/official_releases/qtcreator"
REMOTE_PATH="${SHORT_VERSION}/${VERSION}/installer_source/${HOST_OS}/qtcreator.7z"
echo "${BASE_URL}/${REMOTE_PATH}"
return 0