Skip to content

Commit d428e16

Browse files
committed
[Build] Fix signing of the artifact-checksums list on download page
The checksum signature is gone since: https://archive.eclipse.org/eclipse/downloads/drops4/R-4.16-202006040540/ This is caused by a failure in the signing process because recent versions of GPG ask for the passphrase via a dialog by default. In order obtain it through a environment variable one has disable pinentry using: --pinentry-mode loopback - Generally simplify the creation of the list of artifact checksums - Remove unnecessary specification of '--yes' option. - Remove attempt to read 'bashUtilities.shsource' as it seems to have been gone in general. - specify the 'client' through a environment variable in the caller
1 parent 4660984 commit d428e16

File tree

5 files changed

+24
-96
lines changed

5 files changed

+24
-96
lines changed
Lines changed: 18 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#!/usr/bin/env bash
1+
#!/bin/bash
22
#*******************************************************************************
3-
# Copyright (c) 2017 IBM Corporation and others.
3+
# Copyright (c) 2017, 2025 IBM Corporation and others.
44
#
55
# This program and the accompanying materials
66
# are made available under the terms of the Eclipse Public License 2.0
@@ -13,115 +13,39 @@
1313
# David Williams - initial API and implementation
1414
#*******************************************************************************
1515
#
16-
# this localBuildProperties.shsource file is to ease local builds to
17-
# override some variables.
18-
# It should not be used for production builds.
19-
source localBuildProperties.shsource 2>/dev/null
20-
2116
echo "[DEBUG] Producing checksums starting"
2217
echo "[DEBUG] current directory: ${PWD}"
23-
if [[ -z "${SCRIPT_PATH}" ]]
24-
then
25-
echo -e "\n\tWARNING: SCRIPT_PATH not defined in ${0##*/}"
26-
else
27-
source "${SCRIPT_PATH}/bashUtilities.shsource"
28-
checkSumStart="$(date +%s )"
29-
fi
30-
31-
# This checkSums script is called twice, once while publishing Eclipse DL site, again
32-
# when publishing Equinox DL site. We use a simple heuristic to
33-
# make use of "eclipse" or "equinox".
34-
# TODO: better design to require it to be passed in?
35-
currentDirectory="${PWD}"
36-
equinoxPattern="^.*equinox.*$"
37-
eclipsePattern="^.*eclipse.*$"
38-
if [[ "${currentDirectory}" =~ $equinoxPattern ]]
39-
then
40-
client="equinox"
41-
elif [[ "${currentDirectory}" =~ $eclipsePattern ]]
42-
then
43-
client="eclipse"
44-
else
45-
echo -e "\n\t[ERROR]: Unknown client: ${client} in ${0##*/}\n"
46-
exit 1
47-
fi
4818

4919
allCheckSumsSHA512=checksum/${client}-${BUILD_ID}-SUMSSHA512
20+
fileExtensionsToHash='zip dmg gz tar.xz jar'
5021

5122
# Remove the "all" files, here at beginning if they all ready exist,
5223
# so that subsequent calls can all use append (i.e. ">>")
5324

54-
rm ${allCheckSumsSHA512}
55-
56-
#array of zipfiles
57-
zipfiles=`ls *.zip`
58-
59-
for zipfile in ${zipfiles}
60-
do
61-
# There is one zip file to not list, eclipse.platform.releng.aggregator-<hash>.zip, which is merely
62-
# a collected utility scripts used to run unit tests.
63-
aggrPattern="^eclipse.platform.releng.aggregator.*.zip$"
64-
if [[ ! "${zipfile}" =~ $aggrPattern ]]
65-
then
66-
echo [sha512] ${zipfile}
67-
sha512sum -b ${zipfile} | tee checksum/${zipfile}.sha512 >>${allCheckSumsSHA512}
68-
fi
69-
done
70-
71-
#array of dmgfiles
72-
dmgfiles=`ls *.dmg`
73-
74-
for dmgfile in ${dmgfiles}
75-
do
76-
echo [sha512] ${dmgfile}
77-
sha512sum -b ${dmgfile} | tee checksum/${dmgfile}.sha512 >>${allCheckSumsSHA512}
78-
done
79-
80-
#array of tar.gzip files
81-
gzipfiles=`ls *.gz`
82-
83-
for gzipfile in ${gzipfiles}
84-
do
85-
echo [sha512] ${gzipfile}
86-
sha512sum -b ${gzipfile} | tee checksum/${gzipfile}.sha512 >>${allCheckSumsSHA512}
87-
done
88-
89-
#array of tar.xz files
90-
xzfiles=`ls *.tar.xz`
91-
92-
for xzfile in ${xzfiles}
93-
do
94-
echo [sha512] ${xzfile}
95-
sha512sum -b ${xzfile} | tee checksum/${xzfile}.sha512 >>${allCheckSumsSHA512}
96-
done
97-
98-
99-
#array of .jar files
100-
jarfiles=`ls *.jar`
101-
102-
for jarfile in ${jarfiles}
103-
do
104-
echo [sha512] ${jarfile}
105-
sha512sum -b ${jarfile} | tee checksum/${jarfile}.sha512 >>${allCheckSumsSHA512}
25+
rm -f ${allCheckSumsSHA512}
26+
27+
for extension in ${fileExtensionsToHash}; do
28+
files=$(ls *.${extension})
29+
for file in ${files}; do
30+
# There is one zip file to not list, eclipse.platform.releng.aggregator-<hash>.zip, which is merely
31+
# a collected utility scripts used to run unit tests.
32+
aggrPattern="^eclipse.platform.releng.aggregator.*.zip$"
33+
if [[ ! "${file}" =~ $aggrPattern ]]; then
34+
echo [sha512] ${file}
35+
sha512sum -b ${file} | tee checksum/${file}.sha512 >>${allCheckSumsSHA512}
36+
fi
37+
done
10638
done
10739

10840
# We'll always try to sign checksum files, if passphrase file exists
10941
echo "[DEBUG] Producing GPG signatures starting."
110-
# We make double use of the "client". One to simplify signing script. Second to identify times in timefile.
111-
# remember, this "WORKSPACE" is for genie.releng for production builds.
42+
set -e
11243
if [ ! -z "${KEYRING_PASSPHRASE}" ]
11344
then
114-
signature_file512=${allCheckSumsSHA512}.asc
115-
gpg --detach-sign --armor --output ${signature_file512} --batch --yes --passphrase-fd 0 ${allCheckSumsSHA512} <<< "${KEYRING_PASSPHRASE}"
45+
gpg --detach-sign --armor --output ${allCheckSumsSHA512}.asc --batch --pinentry-mode loopback --passphrase-fd 0 ${allCheckSumsSHA512} <<< "${KEYRING_PASSPHRASE}"
11646
else
11747
# We don't treat as ERROR since would be normal in a "local build".
11848
# But, would be an ERROR in production build so could be improved.
11949
echo -e "\n\t[WARNING] The key_passphrase_file did not exist or was not readable.\n"
12050
fi
121-
# if SCRIPT_PATH not defined, we can not call elapsed time
122-
if [[ -n "${SCRIPT_PATH}" ]]
123-
then
124-
checkSumEnd="$(date +%s )"
125-
elapsedTime $checkSumStart $checkSumEnd "${client} Elapsed Time computing checksums"
126-
fi
12751
echo "[DEBUG] Producing checksums ended normally"

eclipse.platform.releng.tychoeclipsebuilder/eclipse/helper.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
executable="/bin/bash"
3131
dir="${buildDirectory}">
3232
<arg line="${EBuilderDir}/eclipse/extras/produceChecksum.sh" />
33+
<env key="client" value="eclipse"/>
3334
</exec>
3435

3536
<!--get static files required in the buildLabel directory -->

eclipse.platform.releng.tychoeclipsebuilder/eclipse/publishingFiles/templateFiles/buildproperties.phpHoldForLocalTests

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ $REPO_AND_ACCESS = "file:///gitroot";
3131
$MAVEN_BREE = "-Pbree-libs";
3232
$GIT_PUSH = "echo no git push done since Nightly";
3333
$LOCAL_REPO = "/shared/eclipse/builds/4N/localMavenRepo";
34-
$SCRIPT_PATH = "/shared/eclipse/builds/4N/production";
3534
$STREAMS_PATH = "/shared/eclipse/builds/4N/gitCache/eclipse.platform.releng.aggregator/streams";
3635
$CBI_JDT_REPO_URL = "";
3736
$CBI_JDT_REPO_URL_ARG = "";

eclipse.platform.releng.tychoeclipsebuilder/equinox/helper.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
executable="/bin/bash"
9191
dir="${equinoxPostingDirectory}/${buildDir}">
9292
<arg line="${EBuilderDir}/eclipse/extras/produceChecksum.sh" />
93+
<env key="client" value="equinox"/>
9394
</exec>
9495

9596

eclipse.platform.releng.tychoeclipsebuilder/equinox/publishingFiles/templateFiles/index.template.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@
2222
$generateChecksumLinks = 'generateChecksumLinks';
2323
$buildlabel = "$EQ_BUILD_DIR_SEG";
2424
$sums512file = "checksum/equinox-$BUILD_ID-SUMSSHA512";
25-
if (file_exists($sums512file)) {
25+
$sums512file_asc = $sums512file.".asc";
26+
if ((file_exists($sums512file)) && (file_exists($sums512file_asc))) {
2627
$gpgchecksumline = "<p style=\"text-indent: 3em;\"><a href=\"$sums512file\">SHA512 Checksums for $BUILD_ID</a>&nbsp;(<a href=\"$sums512file.asc\">GPG</a>)</p>";
28+
} else if (file_exists($sums512file)) {
29+
$gpgchecksumline = "<p style=\"text-indent: 3em;\"><a href=\"$sums512file\">SHA512 Checksums for $BUILD_ID</a>";
2730
}
2831
$html = <<<EOHTML
2932

0 commit comments

Comments
 (0)