diff --git a/projects/golang/go/Makefile b/projects/golang/go/Makefile index 26880aa75..43d1441d5 100644 --- a/projects/golang/go/Makefile +++ b/projects/golang/go/Makefile @@ -42,7 +42,7 @@ IMAGE?=$(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG),$(LATEST_IMAGE) BUILDER_BASE_VERSIONS_YAML=$(BASE_DIRECTORY)/builder-base/versions.yaml BUILDER_BASE_GO_VERSION=$(shell grep -E "^GOLANG_VERSION_$(subst .,,$(GO_SOURCE_VERSION))" $(BUILDER_BASE_VERSIONS_YAML)) GO_BIN_VERSION_WITH_RELEASE=$(subst GOLANG_VERSION_$(subst .,,$(GO_SOURCE_VERSION)): ,,$(BUILDER_BASE_GO_VERSION)) -GO_BIN_VERSION_WITHOUT_RELEASE=$(shell [[ $(GO_BIN_VERSION_WITH_RELEASE) =~ [0-9]+.[0-9]+.[0-9]+ ]] && echo $${BASH_REMATCH[0]}) +GO_BIN_VERSION_WITHOUT_RELEASE=go$(shell [[ $(GO_BIN_VERSION_WITH_RELEASE) =~ [0-9]+.[0-9]+.[0-9]+ ]] && echo $${BASH_REMATCH[0]}) PUSH_IMAGES?=true BUILDKIT_OUTPUT=type=image,oci-mediatypes=true,\"name=$(IMAGE)\",push=$(PUSH_IMAGES) @@ -172,7 +172,7 @@ images-upstream-bins: build \ --frontend dockerfile.v0 \ --opt platform=$(GOOS)/$(ARCH_LOWER) \ - --opt build-arg:GOLANG_ARCHIVE_PATH=$(GOOS)/$(ARCH_LOWER)/go$(GO_BIN_VERSION_WITHOUT_RELEASE).$(GOOS)-$(ARCH_LOWER).tar.gz \ + --opt build-arg:GOLANG_ARCHIVE_PATH=$(GOOS)/$(ARCH_LOWER)/$(GO_BIN_VERSION_WITHOUT_RELEASE).$(GOOS)-$(ARCH_LOWER).tar.gz \ --local dockerfile=$(PROJECT_DIRECTORY)/docker/debianBase \ --local context=$(VERSION_DIRECTORY)/archives \ --progress plain \ diff --git a/projects/golang/go/scripts/get_upstream_golang.sh b/projects/golang/go/scripts/get_upstream_golang.sh index a57ed3b6f..c9f618fc2 100755 --- a/projects/golang/go/scripts/get_upstream_golang.sh +++ b/projects/golang/go/scripts/get_upstream_golang.sh @@ -36,10 +36,10 @@ function build::go::download { local archs=${3} for arch in ${archs/,/ }; do - local filename="$outputDir/${arch}/go$version.${arch/\//-}.tar.gz" + local filename="$outputDir/${arch}/$version.${arch/\//-}.tar.gz" if [ ! -f $filename ]; then - curl -sSLf --retry 5 "https://go.dev/dl/go$version.${arch/\//-}.tar.gz" -o $filename --create-dirs - sha256sum=$(curl -sSLf --retry 5 "https://go.dev/dl/?mode=json" | jq -r --arg tar "go$version.${arch/\//-}.tar.gz" '.[].files[] | if .filename == $tar then .sha256 else "" end' | xargs) + curl -sSLf --retry 5 "https://go.dev/dl/$version.${arch/\//-}.tar.gz" -o $filename --create-dirs + sha256sum=$(curl -sSLf --retry 5 "https://go.dev/dl/?mode=json" | jq -r --arg tar "$version.${arch/\//-}.tar.gz" '.[].files[] | if .filename == $tar then .sha256 else "" end' | xargs) if [[ $(sha256sum ${filename} | cut -d ' ' -f1) != "${sha256sum}" ]]; then echo "CHECKSUMs don't match"