Skip to content

Commit e3b4dbc

Browse files
authored
Merge pull request AdoptOpenJDK#54 from dinogun/arch_fails
Generate builds for arches only if the shasums are not empty.
2 parents cef4100 + 337224d commit e3b4dbc

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

common_functions.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,12 @@ function get_arches() {
102102
eval "declare -A sums="${archsums#*=};
103103
for arch in ${!sums[@]};
104104
do
105-
if [ "${arch}" != "version" ]; then
105+
if [ "${arch}" == "version" ]; then
106+
continue;
107+
fi
108+
# Arch is supported only if the shasum is not empty !
109+
shasum=$(sarray=$1[${arch}]; eval esum=\${$sarray}; echo ${esum});
110+
if [ ! -z "${shasum}" ]; then
106111
echo "${arch} "
107112
fi
108113
done
@@ -299,7 +304,10 @@ function get_sums_for_build_arch() {
299304
# If there are multiple builds for a single version, then pick the latest one.
300305
shasums_url=$(cat ${shasum_file} | grep "checksum_link" | head -1 | awk -F'"' '{ print $4 }');
301306
shasum=$(curl -Ls ${shasums_url} | sed -e 's/<[^>]*>//g' | awk '{ print $1 }');
302-
printf "\t[%s]=\"%s\"\n" ${gsba_arch} ${shasum} >> ${ofile}
307+
# Only print the entry if the shasum is not empty
308+
if [ ! -z "${shasum}" ]; then
309+
printf "\t[%s]=\"%s\"\n" ${gsba_arch} ${shasum} >> ${ofile}
310+
fi
303311
fi
304312
rm -f ${shasum_file}
305313
}

0 commit comments

Comments
 (0)