summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuigi Toscano <ltoscano@redhat.com>2018-05-04 17:55:50 +0200
committerLuigi Toscano <ltoscano@redhat.com>2018-05-07 14:36:30 +0200
commit40b4553dde41f6aa377b7df8363f6357ffce0412 (patch)
treed31f9b60dac1a9113707e54ba8ff64fd15097112
parentcd0668fe9e40c1e77f8c8142aa3a5fe8d6550b11 (diff)
Fix (again) the detection of scala version (now https)stable/pike
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: 15089 Change-Id: I82d3dd0bd000284fb5404483bf3ee34a6fbb147b (cherry picked from commit 30717f25164f12270f5e5afe1532a9b2025d1785)
Notes
Notes (review): Code-Review+2: Telles Mota Vidal Nóbrega <tenobreg@redhat.com> Workflow+1: Telles Mota Vidal Nóbrega <tenobreg@redhat.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Mon, 07 May 2018 14:40:40 +0000 Reviewed-on: https://review.openstack.org/566564 Project: openstack/sahara-image-elements Branch: refs/heads/stable/pike
-rw-r--r--elements/hadoop-mapr/README.rst2
-rwxr-xr-xelements/hadoop-mapr/install.d/41-scala8
2 files changed, 5 insertions, 5 deletions
diff --git a/elements/hadoop-mapr/README.rst b/elements/hadoop-mapr/README.rst
index 267a512..a4ebd4e 100644
--- a/elements/hadoop-mapr/README.rst
+++ b/elements/hadoop-mapr/README.rst
@@ -6,7 +6,7 @@ Creates images with local mirrors of MapR repositories:
6`core <http://package.mapr.com/releases/>`_ and 6`core <http://package.mapr.com/releases/>`_ and
7`ecosystem <http://package.mapr.com/releases/ecosystem-4.x/>`_. 7`ecosystem <http://package.mapr.com/releases/ecosystem-4.x/>`_.
8Installs `OpenJDK <http://http://openjdk.java.net/>`_ and 8Installs `OpenJDK <http://http://openjdk.java.net/>`_ and
9`Scala <http://www.scala-lang.org/>`_. 9`Scala <https://www.scala-lang.org/>`_.
10 10
11In order to create the MapR images with ``diskimage-create.sh``, use the 11In order to create the MapR images with ``diskimage-create.sh``, use the
12following syntax to select the ``MapR`` plugin: 12following syntax to select the ``MapR`` plugin:
diff --git a/elements/hadoop-mapr/install.d/41-scala b/elements/hadoop-mapr/install.d/41-scala
index c1454e6..1ddd035 100755
--- a/elements/hadoop-mapr/install.d/41-scala
+++ b/elements/hadoop-mapr/install.d/41-scala
@@ -11,10 +11,10 @@ echo "START: installing Scala"
11#Current available version 11#Current available version
12DEF_VERSION="2.11.6" 12DEF_VERSION="2.11.6"
13 13
14RETURN_CODE="$(curl -s -o /dev/null -w "%{http_code}" http://www.scala-lang.org/)" 14RETURN_CODE="$(curl -s -L -o /dev/null -w "%{http_code}" https://www.scala-lang.org/)"
15 15
16if [ "$RETURN_CODE" != "200" ]; then 16if [ "$RETURN_CODE" != "200" ]; then
17 echo "http://www.scala-lang.org is unreachable" && exit 1 17 echo "https://www.scala-lang.org is unreachable" && exit 1
18fi 18fi
19 19
20if [ -n "${SCALA_VERSION:-}" ]; then 20if [ -n "${SCALA_VERSION:-}" ]; then
@@ -23,7 +23,7 @@ elif [ "trusty" == "${DIB_RELEASE:-}" ]; then
23 # scale >= 2.12 for ubuntu depends on openjdk-8, not available on trusty 23 # scale >= 2.12 for ubuntu depends on openjdk-8, not available on trusty
24 VERSION=${DEF_VERSION} 24 VERSION=${DEF_VERSION}
25else 25else
26 VERSION="$(curl -s --fail http://www.scala-lang.org| tr -d '\n' | sed 's/^.*<div[^<]\+scala-version">[^0-9]\+\([0-9\.\?]\+\)<.\+$/\1/')" 26 VERSION="$(curl -s -L --fail https://www.scala-lang.org| tr -d '\n' | sed 's/^.*<div[^<]\+scala-version">[^0-9]\+\([0-9\.\?]\+\)<.\+$/\1/')"
27 27
28 if [ $? != 0 -o -z "${VERSION}" ]; then 28 if [ $? != 0 -o -z "${VERSION}" ]; then
29 echo "Installing default version $DEF_VERSION" 29 echo "Installing default version $DEF_VERSION"
@@ -33,7 +33,7 @@ fi
33 33
34PKG=scala-${VERSION} 34PKG=scala-${VERSION}
35 35
36URL="http://downloads.lightbend.com/scala/${VERSION}" 36URL="https://downloads.lightbend.com/scala/${VERSION}"
37 37
38if [ "$DISTRO_NAME" = "ubuntu" ]; then 38if [ "$DISTRO_NAME" = "ubuntu" ]; then
39 wget -N ${URL}/${PKG}.deb 39 wget -N ${URL}/${PKG}.deb