summaryrefslogtreecommitdiffstats
path: root/solenv
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-08-30 15:16:22 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-08-30 15:16:22 +0200
commitb44f062df9f541b0a1bea974556483c7a5876b35 (patch)
treeaa440b57797fd71b7b79556f7f8274c5a95370f9 /solenv
parentAvoid loplugin:constparam when param is cast to void (diff)
downloadcore-b44f062df9f541b0a1bea974556483c7a5876b35.tar.gz
core-b44f062df9f541b0a1bea974556483c7a5876b35.zip
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
Diffstat (limited to 'solenv')
-rw-r--r--solenv/bin/getcompver.awk9
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 ) {