Extract version number passed set '{java-version}' 18/14918/5
authorAnil Belur <abelur@linuxfoundation.org>
Fri, 15 Mar 2019 02:05:10 +0000 (12:05 +1000)
committerAnil Belur <abelur@linuxfoundation.org>
Fri, 15 Mar 2019 02:05:10 +0000 (12:05 +1000)
commitc0b4bc95a6d160f6fd3edc095f9fd277c80769d0
treed17ef7480de4365620875866658d2b2ab9322e8d
parent79494c0d03c62ada57d40e2ed4a00fcfeece7151
Extract version number passed set '{java-version}'

When the version number string is multi-digits ex: openjdk11
"${SET_JDK_VERSION: -1}" returns '1' which is incorrect.

The change fixes version number extraction for the string
passed to env variable $SET_JDK_VERSION.

Also update the regex to handle values with special chars.

Issue: RELENG-1853
Change-Id: I52c49fec007bad70d4a42d4c20a45b35fec3997c
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
shell/update-java-alternatives.sh