[Ubuntu] Convert non valid java semver (#5131)

* Convert non valid java semver

* remove whitespace

* Update regex
This commit is contained in:
Aleksandr Chebotov
2022-02-25 15:55:30 +03:00
committed by GitHub
parent 5b141f6a20
commit b7e6ffd8d3

View File

@@ -76,6 +76,10 @@ installOpenJDK() {
# If there is no semver in java release, then extract java version from -fullversion
[[ -z ${fullJavaVersion} ]] && fullJavaVersion=$(${javaVersionPath}/bin/java -fullversion 2>&1 | tr -d "\"" | tr "+" "-" | awk '{print $4}')
# Convert non valid semver like 11.0.14.1-9 -> 11.0.14-9
# https://github.com/adoptium/temurin-build/issues/2248
[[ ${fullJavaVersion} =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+ ]] && fullJavaVersion=$(echo $fullJavaVersion | sed -E 's/\.[0-9]+-/-/')
javaToolcacheVersionPath="${JAVA_TOOLCACHE_PATH}/${fullJavaVersion}"
mkdir -p "${javaToolcacheVersionPath}"