update go version

This commit is contained in:
ston1th 2025-10-11 14:37:14 +02:00
commit bf69203c66

View file

@ -23,8 +23,13 @@ v20_sum="baaebb7ad7f0054ac4f7fd39ec6e1fec17e187301cc479f499fab7ac61ca58c7"
v20_bootstrap="${install_dir}/bootstrap-${v20}"
tgz20="${v20}.tar.gz"
path_v20="${install_dir}/${tgz20}"
v22="go1.22.6"
v22_sum="71cbf4f555da51df93f71b1726c69f2e80f62bbe2e7ce1c5c39c3d57fa385b14"
v22_bootstrap="${install_dir}/bootstrap-${v22}"
tgz22="${v22}.tar.gz"
path_v22="${install_dir}/${tgz22}"
v="${1-1.23.5}"
v="${1-1.25.2}"
case "${v}" in
1.16.7) new_sum="07502f16366fbc697b1b09b842d29116e6d6607c9dc42b1d7c54b96f528c7952";;
1.17.1) new_sum="670ce36e100669f9be572a1603858ce4a64eb4b21a31fa5cdefb778609c40337";;
@ -50,8 +55,10 @@ case "${v}" in
1.23.0) new_sum="0bc1065ced4718d43c8cf945e7c321b6a8814defd4f7cae9588719494021bddf" v1_22=1;;
1.23.2) new_sum="fc3448a68fca887ceb0e0d4357d0ecd05d54a78e052f8667b283e745c87e7f2e" v1_22=1;;
1.23.5) new_sum="742aa265a47019d2b87bd3d9c42fd7f1e2fed133557e64b0a3e8749925ce5123" v1_22=1;;
1.25.2) new_sum="301f8d65edb32ab2080fbe80b559a6369c0e3f792d2b0d1078a2764f8b579bcb" v1_25=1;;
*) errx "no hash found for version ${v}";;
esac
[[ "${v1_25}" -eq 1 ]] && v1_22=1
[[ "${v1_22}" -eq 1 ]] && v1_20=1
new="go${v}"
@ -82,6 +89,13 @@ if [[ "${v1_22}" -eq 1 ]] && [[ ! -d "${v20_bootstrap}" ]]; then
mv ${install_dir}/go-${v20} ${v20_bootstrap}
fi
if [[ "${v1_25}" -eq 1 ]] && [[ ! -d "${v22_bootstrap}" ]]; then
curl -sSL "${url}/${tgz22}" >${path_v22}
[[ "$(sha256sum ${path_v22}|cut -d" " -f1)" != "${v22_sum}" ]] && errx "wrong checksum: ${path_v22}"
tar xfz ${path_v22} -C ${install_dir}
mv ${install_dir}/go-${v22} ${v22_bootstrap}
fi
if [[ ! -d "${new_dir}" ]]; then
curl -sSL "${url}/${tgznew}" >${path_new}
[[ -z "${new_sum}" ]] && { echo "hashsum for version ${new}:"; sha256sum ${path_new}|cut -d" " -f1; exit 0; }
@ -108,8 +122,16 @@ if [[ "${v1_22}" -eq 1 ]] && [[ ! -x "${v20_bootstrap}/bin/go" ]]; then
./make.bash
fi
if [[ "${v1_25}" -eq 1 ]] && [[ ! -x "${v22_bootstrap}/bin/go" ]]; then
export GOROOT_BOOTSTRAP=${v20_bootstrap}
cd ${v22_bootstrap}/src
./make.bash
fi
if [[ ! -x "${new_dir}/bin/go" ]]; then
if [[ "${v1_22}" -eq 1 ]]; then
if [[ "${v1_25}" -eq 1 ]]; then
bootstrap=${v22_bootstrap}
elif [[ "${v1_22}" -eq 1 ]]; then
bootstrap=${v20_bootstrap}
elif [[ "${v1_20}" -eq 1 ]]; then
bootstrap=${v19_bootstrap}