Skip to content

Commit 9dc39f6

Browse files
committed
Fix GPG signature checkout of downloaded boot JDK
Signed-off-by: Stewart X Addison <[email protected]>
1 parent d8e3156 commit 9dc39f6

File tree

1 file changed

+5
-5
lines changed
  • build-farm/platform-specific-configurations

1 file changed

+5
-5
lines changed

build-farm/platform-specific-configurations/linux.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,15 @@ function downloadBootJDK()
143143
vendor="eclipse"
144144
apiUrlTemplate="https://api.adoptium.net/v3/binary/latest/\${VER}/\${releaseType}/linux/\${downloadArch}/jdk/hotspot/normal/\${vendor}"
145145
apiURL=$(eval echo "${apiUrlTemplate}")
146-
apiSigUrlTemplate="https://api.adoptium.net/v3/assets/feature_releases/\${VER}/\${releaseType}?architecture=\$ARCH&heap_size=normal&image_type=jdk&jvm_impl=hotspot&os=linux&page=0&page_size=1&project=jdk&vendor=eclipse"
147-
apiSigURL=$(eval echo "${apiSigUrlTemplate}")
148146
echo "Downloading GA release of boot JDK version ${VER} from ${apiURL}"
149147
# make-adopt-build-farm.sh has 'set -e'. We need to disable that for
150148
# the fallback mechanism, as downloading of the GA binary might fail.
151149
set +e
152150
curl -L -o bootjdk.tar.gz "${apiURL}"
151+
apiSigURL=$(curl -v "${apiURL}" 2>&1 | tr -d \\r | awk '/^< Location:/{print $3 ".sig"}')
153152
if ! grep "No releases match the request" bootjdk.tar.gz; then
154-
curl -L -o bootjdk.tar.gz.sig "$(curl -s "${apiSigURL}" | grep "signature_link.*-jdk_" | awk '{split($0,a,"\""); print a[4]}' | head -1)"
153+
curl -L -o bootjdk.tar.gz.sig "${apiSigURL}"
154+
curl
155155
gpg --keyserver keyserver.ubuntu.com --recv-keys 3B04D753C9050D9A5D343F39843C48A565F8F04B
156156
echo -e "5\ny\n" | gpg --batch --command-fd 0 --expert --edit-key 3B04D753C9050D9A5D343F39843C48A565F8F04B trust;
157157
gpg --verify bootjdk.tar.gz.sig bootjdk.tar.gz || exit 1
@@ -167,12 +167,12 @@ function downloadBootJDK()
167167
# shellcheck disable=SC2034
168168
vendor="adoptium"
169169
apiURL=$(eval echo ${apiUrlTemplate})
170-
apiSigURL=$(eval echo "${apiSigUrlTemplate}")
171170
echo "Attempting to download EA release of boot JDK version ${VER} from ${apiURL}"
172171
set +e
173172
curl -L -o bootjdk.tar.gz "${apiURL}"
174173
if ! grep "No releases match the request" bootjdk.tar.gz; then
175-
curl -L -o bootjdk.tar.gz.sig "$(curl -s "${apiSigURL}" | grep "signature_link.*-jdk_" | awk '{split($0,a,"\""); print a[4]}' | head -1)"
174+
apiSigURL=$(curl -v "${apiURL}" 2>&1 | tr -d \\r | awk '/^< Location:/{print $3 ".sig"}')
175+
curl -L -o bootjdk.tar.gz.sig "${apiSigURL}"
176176
gpg --keyserver keyserver.ubuntu.com --recv-keys 3B04D753C9050D9A5D343F39843C48A565F8F04B
177177
echo -e "5\ny\n" | gpg --batch --command-fd 0 --expert --edit-key 3B04D753C9050D9A5D343F39843C48A565F8F04B trust;
178178
gpg --verify bootjdk.tar.gz.sig bootjdk.tar.gz || exit 1

0 commit comments

Comments
 (0)