From 47326daf867455d59bef74ea75d0062370f50bd8 Mon Sep 17 00:00:00 2001 From: Stewart X Addison Date: Mon, 2 Dec 2024 14:46:22 +0000 Subject: [PATCH 1/2] Use standard sed syntax for translating filenames Signed-off-by: Stewart X Addison --- sbin/build.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sbin/build.sh b/sbin/build.sh index 27a314f9f..f76a0b91a 100755 --- a/sbin/build.sh +++ b/sbin/build.sh @@ -2094,7 +2094,9 @@ getTargetFileNameForComponent() { echo "${target_file_name}" | sed "s/-jdk/-${component}/" else # if no pattern is found, append the component name right before the extension. - echo "${target_file_name}" | sed -r "s/(.+)(\.tar\.gz|\.zip)/\1-${component}\2/" + echo "${target_file_name}" | sed \ + -e "s/\(.*\)\(\.tar\.gz\)/\1-$component\2/" \ + -e "s/\(.*\)\(\.zip\)/\1-${component}\2/" fi } From 290bcb3c863607fb32eb26c0fe4500cfeddadd75 Mon Sep 17 00:00:00 2001 From: Stewart X Addison Date: Tue, 3 Dec 2024 10:39:16 +0000 Subject: [PATCH 2/2] Comment Signed-off-by: Stewart X Addison --- sbin/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/sbin/build.sh b/sbin/build.sh index f76a0b91a..e0bd66160 100755 --- a/sbin/build.sh +++ b/sbin/build.sh @@ -2094,6 +2094,7 @@ getTargetFileNameForComponent() { echo "${target_file_name}" | sed "s/-jdk/-${component}/" else # if no pattern is found, append the component name right before the extension. + # Stopped using -r here and split this in 2 as -r not a standard sed argument echo "${target_file_name}" | sed \ -e "s/\(.*\)\(\.tar\.gz\)/\1-$component\2/" \ -e "s/\(.*\)\(\.zip\)/\1-${component}\2/"