From 1da4e1ff020e60d37ce434453e112851a800dd09 Mon Sep 17 00:00:00 2001 From: ston1th Date: Fri, 29 Mar 2024 20:25:51 +0100 Subject: [PATCH] bump version to v1.22.1 --- build-go.sh | 40 +++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/build-go.sh b/build-go.sh index f489383..4dd1555 100755 --- a/build-go.sh +++ b/build-go.sh @@ -18,8 +18,13 @@ v19_sum="1fe106fce9342c2a7ceeb04477341457cc9f0a3c07b9f2a993af09d654307f56" v19_bootstrap="${install_dir}/bootstrap-${v19}" tgz19="${v19}.tar.gz" path_v19="${install_dir}/${tgz19}" +v20="go1.20.6" +v20_sum="baaebb7ad7f0054ac4f7fd39ec6e1fec17e187301cc479f499fab7ac61ca58c7" +v20_bootstrap="${install_dir}/bootstrap-${v20}" +tgz20="${v20}.tar.gz" +path_v20="${install_dir}/${tgz20}" -v="${1-1.21.5}" +v="${1-1.22.1}" case "${v}" in 1.16.7) new_sum="07502f16366fbc697b1b09b842d29116e6d6607c9dc42b1d7c54b96f528c7952";; 1.17.1) new_sum="670ce36e100669f9be572a1603858ce4a64eb4b21a31fa5cdefb778609c40337";; @@ -36,13 +41,15 @@ case "${v}" in 1.19.5) new_sum="1c24a6a2bf71d64d0ca8e228028d6108521f06b6edc7bf6b34ed6d767a795809";; 1.19.6) new_sum="0c7f4e6d2de3ae07d60377754955842ad357b0366df01116554fc619b1e99672";; 1.19.7) new_sum="1fe106fce9342c2a7ceeb04477341457cc9f0a3c07b9f2a993af09d654307f56";; - 1.20.1) new_sum="5db737840a740457c1b4b73b90dad6daa57af0da420f3ea51c39a1a81abbcc41";; - 1.20.2) new_sum="176969bb14216dd45121e46d5d0f63d339edb9042d1389d485fb6b21ee172388";; - 1.21.0) new_sum="cf1d9b0504983c1a4c044856c389555070fbc58c3ce1703193a2c3ffe877a8b9";; - 1.21.5) new_sum="20acc9b538ccc9368ca3061849d8ff466f10c71fd858af5a0940fce3c3dbe4db";; + 1.20.1) new_sum="5db737840a740457c1b4b73b90dad6daa57af0da420f3ea51c39a1a81abbcc41" v1_20=1;; + 1.20.2) new_sum="176969bb14216dd45121e46d5d0f63d339edb9042d1389d485fb6b21ee172388" v1_20=1;; + 1.20.6) new_sum="baaebb7ad7f0054ac4f7fd39ec6e1fec17e187301cc479f499fab7ac61ca58c7" v1_20=1;; + 1.21.0) new_sum="cf1d9b0504983c1a4c044856c389555070fbc58c3ce1703193a2c3ffe877a8b9" v1_20=1;; + 1.21.5) new_sum="20acc9b538ccc9368ca3061849d8ff466f10c71fd858af5a0940fce3c3dbe4db" v1_20=1;; + 1.22.1) new_sum="e6dbc2e591b577ef7d3cb0f6572568521c2dcfe8c7521f1253fe23fd624cdc56" v1_22=1;; *) errx "no hash found for version ${v}";; esac -[[ "${v}" =~ 1\.2* ]] && v1_20=1 || v1_20=0 +[[ "${v1_22}" -eq 1 ]] && v1_20=1 new="go${v}" new_dir="${install_dir}/go-${new}" @@ -65,6 +72,13 @@ if [[ "${v1_20}" -eq 1 ]] && [[ ! -d "${v19_bootstrap}" ]]; then mv ${install_dir}/go-${v19} ${v19_bootstrap} fi +if [[ "${v1_22}" -eq 1 ]] && [[ ! -d "${v20_bootstrap}" ]]; then + curl -sSL "${url}/${tgz20}" >${path_v20} + [[ "$(sha256sum ${path_v20}|cut -d" " -f1)" != "${v20_sum}" ]] && errx "wrong checksum: ${path_v20}" + tar xfz ${path_v20} -C ${install_dir} + mv ${install_dir}/go-${v20} ${v20_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; } @@ -85,8 +99,20 @@ if [[ "${v1_20}" -eq 1 ]] && [[ ! -x "${v19_bootstrap}/bin/go" ]]; then ./make.bash fi +if [[ "${v1_22}" -eq 1 ]] && [[ ! -x "${v20_bootstrap}/bin/go" ]]; then + export GOROOT_BOOTSTRAP=${v19_bootstrap} + cd ${v20_bootstrap}/src + ./make.bash +fi + if [[ ! -x "${new_dir}/bin/go" ]]; then - [[ "${v1_20}" -eq 1 ]] && bootstrap=${v19_bootstrap} || bootstrap=${v14_bootstrap} + if [[ "${v1_22}" -eq 1 ]]; then + bootstrap=${v20_bootstrap} + elif [[ "${v1_20}" -eq 1 ]]; then + bootstrap=${v19_bootstrap} + else + bootstrap=${v14_bootstrap} + fi export GOROOT_BOOTSTRAP=${bootstrap} [[ "$(uname -m)" == "x86_64" ]] && export GOARCH=amd64 || export GOARCH=386 cd ${new_dir}/src