From 9297e4f8d8db60cc05ef053e6f9a59b0193163ca Mon Sep 17 00:00:00 2001 From: Foivos Zakkak Date: Tue, 19 Sep 2023 16:37:45 +0300 Subject: [PATCH] Directly extract graalvm archive to target directory This way we avoid issues with releases with 0 MINOR and SECURITY digits in the version number, e.g. 21.0.0 which when decompressed results in a folder called graalvm-community-openjdk-21+35.1 instead of graalvm-community-openjdk-21.0.0+35.1 --- .../main/java/io/quarkus/images/modules/GraalVMModule.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/jdock/src/main/java/io/quarkus/images/modules/GraalVMModule.java b/jdock/src/main/java/io/quarkus/images/modules/GraalVMModule.java index 9efdcdb8..c1569603 100644 --- a/jdock/src/main/java/io/quarkus/images/modules/GraalVMModule.java +++ b/jdock/src/main/java/io/quarkus/images/modules/GraalVMModule.java @@ -25,8 +25,8 @@ public class GraalVMModule extends AbstractModule { && rm -Rf %s"""; private static final String NEW_TEMPLATE = """ - tar xzf %s -C /opt \\ - && mv /opt/graalvm-community-openjdk-%s* /opt/graalvm \\ + mkdir -p /opt/graalvm \\ + && tar xzf %s -C /opt/graalvm --strip-components=1 \\ && rm -Rf %s"""; private final String graalvmVersion; @@ -78,7 +78,6 @@ public List commands(BuildContext bc) { } else { script = NEW_TEMPLATE.formatted( "/tmp/" + artifact.name, // tar - graalvmVersion, "/tmp/" + artifact.name); // rm }