Fix (again) 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: 15089 Change-Id: I82d3dd0bd000284fb5404483bf3ee34a6fbb147b
This commit is contained in:
parent
ba498abc7d
commit
30717f2516
@ -6,7 +6,7 @@ Creates images with local mirrors of MapR repositories:
|
|||||||
`core <http://package.mapr.com/releases/>`_ and
|
`core <http://package.mapr.com/releases/>`_ and
|
||||||
`ecosystem <http://package.mapr.com/releases/ecosystem-4.x/>`_.
|
`ecosystem <http://package.mapr.com/releases/ecosystem-4.x/>`_.
|
||||||
Installs `OpenJDK <http://http://openjdk.java.net/>`_ and
|
Installs `OpenJDK <http://http://openjdk.java.net/>`_ and
|
||||||
`Scala <http://www.scala-lang.org/>`_.
|
`Scala <https://www.scala-lang.org/>`_.
|
||||||
|
|
||||||
In order to create the MapR images with ``diskimage-create.sh``, use the
|
In order to create the MapR images with ``diskimage-create.sh``, use the
|
||||||
following syntax to select the ``MapR`` plugin:
|
following syntax to select the ``MapR`` plugin:
|
||||||
|
@ -11,10 +11,10 @@ echo "START: installing Scala"
|
|||||||
#Current available version
|
#Current available version
|
||||||
DEF_VERSION="2.11.6"
|
DEF_VERSION="2.11.6"
|
||||||
|
|
||||||
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
|
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
|
fi
|
||||||
|
|
||||||
if [ -n "${SCALA_VERSION:-}" ]; then
|
if [ -n "${SCALA_VERSION:-}" ]; then
|
||||||
@ -23,7 +23,7 @@ elif [ "trusty" == "${DIB_RELEASE:-}" ]; then
|
|||||||
# scale >= 2.12 for ubuntu depends on openjdk-8, not available on trusty
|
# scale >= 2.12 for ubuntu depends on openjdk-8, not available on trusty
|
||||||
VERSION=${DEF_VERSION}
|
VERSION=${DEF_VERSION}
|
||||||
else
|
else
|
||||||
VERSION="$(curl -s --fail http://www.scala-lang.org| tr -d '\n' | sed 's/^.*<div[^<]\+scala-version">[^0-9]\+\([0-9\.\?]\+\)<.\+$/\1/')"
|
VERSION="$(curl -s -L --fail https://www.scala-lang.org| tr -d '\n' | sed 's/^.*<div[^<]\+scala-version">[^0-9]\+\([0-9\.\?]\+\)<.\+$/\1/')"
|
||||||
|
|
||||||
if [ $? != 0 -o -z "${VERSION}" ]; then
|
if [ $? != 0 -o -z "${VERSION}" ]; then
|
||||||
echo "Installing default version $DEF_VERSION"
|
echo "Installing default version $DEF_VERSION"
|
||||||
@ -33,7 +33,7 @@ fi
|
|||||||
|
|
||||||
PKG=scala-${VERSION}
|
PKG=scala-${VERSION}
|
||||||
|
|
||||||
URL="http://downloads.lightbend.com/scala/${VERSION}"
|
URL="https://downloads.lightbend.com/scala/${VERSION}"
|
||||||
|
|
||||||
if [ "$DISTRO_NAME" = "ubuntu" ]; then
|
if [ "$DISTRO_NAME" = "ubuntu" ]; then
|
||||||
wget -N ${URL}/${PKG}.deb
|
wget -N ${URL}/${PKG}.deb
|
||||||
|
Loading…
Reference in New Issue
Block a user