dcache
dcache copied to clipboard
Fix java version check
Motivation: Solves the problem that #6382 is reporting, which is being caused by non-uniformity between 'java -version' outputs from different systems and versions.
Modification:
Change the java version detection method to use awk to get everything after the 'version ' part of the 'java -version' output. Then use some RegEx to ensure that it starts with 11-19.
The used RegEx is: ^1[1-9](.*)?$.
Tested against following cases:
# Passed:
11-jdk
17.0.0
17-jdk
17.0
18.0
17-Oracle
17_312.0afa
17mycustomversion
13java
17openjdk
13-openjdk
17
11
# Failed:
1.8.0_312
1.8.0-312
1.8.0 312
1
1.0
10.0
1.1.0
Result: The java version check hopefully works as expected.
Signed-off-by: Lukas Mansour [email protected]
Can one of the admins verify this patch?
Can one of the admins verify this patch?
Can one of the admins verify this patch?
Can one of the admins verify this patch?
Can one of the admins verify this patch?
Can one of the admins verify this patch?
ok to test
retest this please
retest this please
retest this please
retest this please
retest this please
retest this please
retest this please
retest this please
I guess the error
bin/populate: 59: /scratch/jenkins/jenkins/workspace/dCache-master-debian/packages/system-test/target/dcache/share/lib/loadConfig.sh: Syntax error: "(" unexpected (expecting "then")
is the result of this change. Can you check debian build?
Finally got to work on fixing this PR, took a while, the issue was caused by the =~ only being supported by the Bourne-Again Shell and not just shell (not sure on this, but probably). Issue now solved by just using grep, probably the safer solution.
ok to test
ok to test
Thanks, @LukasMansour
Thanks, @LukasMansour
No problem, please note Closes: #6382