aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2022-07-14 10:58:14 +0200
committerGitHub <noreply@github.com>2022-07-14 16:58:14 +0800
commit7740779b28e53cdf0a9780a39af71e3ee353e170 (patch)
treed899b5969094cab3bfb6f06a75b9da0b280b598a /Makefile
parentaec6b30e2a599645b563425595ab66fdc5d3928a (diff)
downloadgitea-7740779b28e53cdf0a9780a39af71e3ee353e170.tar.gz
gitea-7740779b28e53cdf0a9780a39af71e3ee353e170.zip
Fix versions check for busybox `sh` (#20358)
`printf` in busybox emits a ugly 'invalid number' error when formatting string variables are present. Avoid that by reducing the go version check to just two digits, which ought to be enough as patch-level go versions are meant to be compatible. Avoid error on node-check as well.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile6
1 files changed, 3 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 41d39b4c32..5536788613 100644
--- a/Makefile
+++ b/Makefile
@@ -201,9 +201,9 @@ help:
.PHONY: go-check
go-check:
- $(eval MIN_GO_VERSION_STR := $(shell grep -Eo '^go\s+[0-9]+\.[0-9.]+' go.mod | cut -d' ' -f2))
- $(eval MIN_GO_VERSION := $(shell printf "%03d%03d%03d" $(shell echo '$(MIN_GO_VERSION_STR)' | tr '.' ' ')))
- $(eval GO_VERSION := $(shell printf "%03d%03d%03d" $(shell $(GO) version | grep -Eo '[0-9]+\.[0-9.]+' | tr '.' ' ');))
+ $(eval MIN_GO_VERSION_STR := $(shell grep -Eo '^go\s+[0-9]+\.[0-9]+' go.mod | cut -d' ' -f2))
+ $(eval MIN_GO_VERSION := $(shell printf "%03d%03d" $(shell echo '$(MIN_GO_VERSION_STR)' | tr '.' ' ')))
+ $(eval GO_VERSION := $(shell printf "%03d%03d" $(shell $(GO) version | grep -Eo '[0-9]+\.[0-9]+' | tr '.' ' ');))
@if [ "$(GO_VERSION)" -lt "$(MIN_GO_VERSION)" ]; then \
echo "Gitea requires Go $(MIN_GO_VERSION_STR) or greater to build. You can get it at https://go.dev/dl/"; \
exit 1; \