From da5d5cf92fafcdc0f31a76d2955e8ac9c327c100 Mon Sep 17 00:00:00 2001 From: Bengt Thuree Date: Wed, 19 Feb 2020 12:01:27 +1100 Subject: [PATCH] Install netselect depending on the Ubuntu arch Change-Id: Ie93b7b5d510ff1e067db4fcfc1020f9ae93dadcf Signed-off-by: Bengt Thuree Signed-off-by: Eric Ball Signed-off-by: Anil Belur --- provision/install-python.sh | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/provision/install-python.sh b/provision/install-python.sh index fc8f240..44056c3 100755 --- a/provision/install-python.sh +++ b/provision/install-python.sh @@ -34,10 +34,27 @@ if is_ubuntu; then # apt{-get} does not refresh the package mirrors (for packer builds run # within Jenkins), therefore fails with "E: Unable to locate package # python-minimal" while installing python-minimal. - echo "Install netselect to choose a mirror." + _ARCH="$(uname -m)" + + case $_ARCH in + x86_64) + NETSELECT_DEB="netselect_0.3.ds1-28+b1_amd64.deb" + ;; + aarch64) + NETSELECT_DEB="netselect_0.3.ds1-28+b1_arm64.deb" + ;; + *) + echo "Unknown arch ${_ARCH}. Exiting..." + exit 1 + esac + + echo "NetSelect version to install is ${NETSELECT_DEB}" + + echo "Install netselect from debian to choose a mirror." apt install wget -y - wget http://ftp.au.debian.org/debian/pool/main/n/netselect/netselect_0.3.ds1-26_amd64.deb - dpkg -i netselect_0.3.ds1-26_amd64.deb + wget http://ftp.au.debian.org/debian/pool/main/n/netselect/${NETSELECT_DEB} + dpkg -i ${NETSELECT_DEB} + apt install netselect -y if ! netselect -s 20 -t 40 "$(wget -qO - mirrors.ubuntu.com/mirrors.txt)"; then echo "NOTE: Unable to refresh 'sources.list'" fi -- 2.16.6