diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-08-30 15:16:22 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2021-05-10 12:04:18 +0200 |
commit | fde616149d83edba9c77dc2406361da04a8b13a3 (patch) | |
tree | 1a1e5c4809a471010dcab55f708622ef53502189 | |
parent | 03e6e58a9c690768c480767f23d04e7d218c9228 (diff) |
Adapt getcompver.awk to Java 9
...where at least <http://jdk.java.net/9/> "JDK 9 Early-Access Builds" 'java
-version' outputs a single-digit
java version "9"
Change-Id: I7807f56593e5436418b49950ca6c2a178d6721f5
-rw-r--r-- | solenv/bin/getcompver.awk | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/solenv/bin/getcompver.awk b/solenv/bin/getcompver.awk index ae08f4e21790..6744c4dc5c7c 100644 --- a/solenv/bin/getcompver.awk +++ b/solenv/bin/getcompver.awk @@ -40,8 +40,13 @@ BEGIN { /java version/ || /openjdk version/ { compiler_matched = 1 # match on the format of the java versions ( d[d].d[d].d[d] ) - x = match( $0, /[0-9]*\.[0-9]*\.[0-9]*/ ) - CCversion = substr( $0, RSTART, RLENGTH) + if (match($0, /[0-9]+\.[0-9]+\.[0-9]+/)) { + CCversion = substr($0, RSTART, RLENGTH) + } else if (match($0, /[0-9]+\.[0-9]+/)) { + CCversion = substr($0, RSTART, RLENGTH) "." + } else if (match($0, /[0-9]+/)) { + CCversion = substr($0, RSTART, RLENGTH) ".." + } } /^[0-9]*[.][0-9]*\r*$/ { if ( compiler_matched == 0 ) { |