From 9abcec3c828710df16b20a886b085ab40e4fa45d Mon Sep 17 00:00:00 2001 From: Luigi Toscano Date: Fri, 4 May 2018 17:54:58 +0200 Subject: [PATCH] Fix the detection of scala version (now https) The www.scala-lang.org switched to https and the curl call did not account for this scenario, so it failed. Switch the address to https and as extra measure add also the -L argument, which forces curl to follow the redirects. Switch also the download URL to https. Story: 2001964 Task: 15088 Change-Id: I9d28c2ad56292998a6b7aaea421b98e136fbf6e1 --- sahara/plugins/mapr/resources/images/centos/install_scala | 8 ++++---- sahara/plugins/mapr/resources/images/ubuntu/install_scala | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sahara/plugins/mapr/resources/images/centos/install_scala b/sahara/plugins/mapr/resources/images/centos/install_scala index 773ca2651a..ed73dcfc66 100644 --- a/sahara/plugins/mapr/resources/images/centos/install_scala +++ b/sahara/plugins/mapr/resources/images/centos/install_scala @@ -6,16 +6,16 @@ DEF_VERSION="2.11.6" if [ $test_only -eq 0 ]; then - RETURN_CODE="$(curl -s -o /dev/null -w "%{http_code}" http://www.scala-lang.org/)" + RETURN_CODE="$(curl -s -L -o /dev/null -w "%{http_code}" https://www.scala-lang.org/)" if [ "$RETURN_CODE" != "200" ]; then - echo "http://www.scala-lang.org is unreachable" && exit 1 + echo "https://www.scala-lang.org is unreachable" && exit 1 fi if [ "${scala_version}" != "1" ]; then VERSION=$scala_version else - VERSION="$(curl -s --fail http://www.scala-lang.org| tr -d '\n' | sed 's/^.*[^0-9]\+\([0-9\.\?]\+\)<.\+$/\1/')" + VERSION="$(curl -s -L --fail https://www.scala-lang.org| tr -d '\n' | sed 's/^.*[^0-9]\+\([0-9\.\?]\+\)<.\+$/\1/')" if [ $? != 0 -o -z "${VERSION}" ]; then echo "Installing default version $DEF_VERSION" @@ -25,7 +25,7 @@ if [ $test_only -eq 0 ]; then PKG=scala-${VERSION} - URL="http://downloads.lightbend.com/scala/${VERSION}" + URL="https://downloads.lightbend.com/scala/${VERSION}" rpm -Uhv ${URL}/${PKG}.rpm fi diff --git a/sahara/plugins/mapr/resources/images/ubuntu/install_scala b/sahara/plugins/mapr/resources/images/ubuntu/install_scala index 09ff75afce..8bec1ab075 100644 --- a/sahara/plugins/mapr/resources/images/ubuntu/install_scala +++ b/sahara/plugins/mapr/resources/images/ubuntu/install_scala @@ -4,9 +4,9 @@ echo "START: installing Scala" DEF_VERSION="2.11.6" if [ $test_only -eq 0 ]; then - RETURN_CODE="$(curl -s -o /dev/null -w "%{http_code}" http://www.scala-lang.org/)" + RETURN_CODE="$(curl -s -L -o /dev/null -w "%{http_code}" https://www.scala-lang.org/)" if [ "$RETURN_CODE" != "200" ]; then - echo "http://www.scala-lang.org is unreachable" && exit 1 + echo "https://www.scala-lang.org is unreachable" && exit 1 fi if [ $(lsb_release -c -s) == "trusty" ]; then @@ -15,7 +15,7 @@ if [ $test_only -eq 0 ]; then if [ "${scala_version}" != "1" ]; then VERSION=$scala_version else - VERSION="$(curl -s --fail http://www.scala-lang.org| tr -d '\n' | sed 's/^.*[^0-9]\+\([0-9\.\?]\+\)<.\+$/\1/')" + VERSION="$(curl -s -L --fail https://www.scala-lang.org| tr -d '\n' | sed 's/^.*[^0-9]\+\([0-9\.\?]\+\)<.\+$/\1/')" if [ $? != 0 -o -z "${VERSION}" ]; then echo "Installing default version $DEF_VERSION" @@ -26,7 +26,7 @@ if [ $test_only -eq 0 ]; then PKG=scala-${VERSION} - URL="http://downloads.lightbend.com/scala/${VERSION}" + URL="https://downloads.lightbend.com/scala/${VERSION}" wget -N ${URL}/${PKG}.deb dpkg -i ${PKG}.deb