diff --git a/makejdk-any-platform.1 b/makejdk-any-platform.1 index f52f95f31..8b840d957 100755 --- a/makejdk-any-platform.1 +++ b/makejdk-any-platform.1 @@ -26,6 +26,9 @@ that you are building for further details. This will start a Docker container and build you the latest Java 8 Temurin binary from the source at https://github.com/adoptium/openjdk-jdk8u +Note that the main argument, in this case jdk8, is compared and enforced +against an enumeration - jdk8, jdk8u, ... jdk21, jdk21u, ...jdk. Nothing else. +You can workaround this by \-\-version switch. Please visit https://www.adoptium.net for further support diff --git a/sbin/common/common.sh b/sbin/common/common.sh index a2eac67a9..8508ee0dc 100755 --- a/sbin/common/common.sh +++ b/sbin/common/common.sh @@ -17,6 +17,17 @@ function setOpenJdkVersion() { local forest_name=$1 + # The argument passed here have actually very strict format of jdk8, jdk8u..., jdk + # the build may fail later if this is not honoured. + # If your repository has a different name, you can use --version or build from dir/snapshot + local forest_name_check=0 + echo "$forest_name" | grep -q -e "^jdk$" -e "^jdk[0-9]\\{1,3\\}[u]\\{0,1\\}$" || forest_name_check=$? + if [ ${forest_name_check} -ne 0 ]; then + echo "The mandatory repo argument has a very strict format 'jdk[0-9]{1,3}[u]{0,1}' or just plain 'jdk' for tip. '$forest_name' does not match." + echo "This can be worked around by using '--version jdkXYu'. If set (and matching) then the main argument can have any value." + exit 1 + fi + # Derive the openjdk_core_version from the forest name. local openjdk_core_version=${forest_name} if [[ ${forest_name} == *u ]]; then