Minor Cleanup 97/62997/1
authorTim Johnson <tijohnson@linuxfoundation.org>
Thu, 30 Jan 2020 16:12:45 +0000 (08:12 -0800)
committerTim Johnson <tijohnson@linuxfoundation.org>
Thu, 30 Jan 2020 16:12:45 +0000 (08:12 -0800)
Change-Id: Ia826901dbbc1a3fd6f5df4af22418015b9dbc78c
Signed-off-by: Tim Johnson <tijohnson@linuxfoundation.org>
provision/install-python.sh

index 040f8ba..fc8f240 100755 (executable)
@@ -38,10 +38,11 @@ if is_ubuntu; then
     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
-    set +e # DO NOT cause build failure if any mirrors are not reachable.
-    netselect -s 20 -t 40 "$(wget -qO - mirrors.ubuntu.com/mirrors.txt)"
-    set -e
-    sed -i 's/http:\/\/us.archive.ubuntu.com\/ubuntu\//http:\/\/ubuntu.uberglobalmirror.com\/archive\//' /etc/apt/sources.list
+    if ! netselect -s 20 -t 40 "$(wget -qO - mirrors.ubuntu.com/mirrors.txt)"; then
+        echo "NOTE: Unable to refresh 'sources.list'"
+    fi
+    sed -i 's#http://us.archive.ubuntu.com/ubuntu#http://ubuntu.uberglobalmirror.com/archive#' \
+        /etc/apt/sources.list
 
     echo "Installing python-minimal..."
     apt clean all -y