Skip to content

Commit 7740779

Browse files
authored
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.
1 parent aec6b30 commit 7740779

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,9 @@ help:
201201

202202
.PHONY: go-check
203203
go-check:
204-
$(eval MIN_GO_VERSION_STR := $(shell grep -Eo '^go\s+[0-9]+\.[0-9.]+' go.mod | cut -d' ' -f2))
205-
$(eval MIN_GO_VERSION := $(shell printf "%03d%03d%03d" $(shell echo '$(MIN_GO_VERSION_STR)' | tr '.' ' ')))
206-
$(eval GO_VERSION := $(shell printf "%03d%03d%03d" $(shell $(GO) version | grep -Eo '[0-9]+\.[0-9.]+' | tr '.' ' ');))
204+
$(eval MIN_GO_VERSION_STR := $(shell grep -Eo '^go\s+[0-9]+\.[0-9]+' go.mod | cut -d' ' -f2))
205+
$(eval MIN_GO_VERSION := $(shell printf "%03d%03d" $(shell echo '$(MIN_GO_VERSION_STR)' | tr '.' ' ')))
206+
$(eval GO_VERSION := $(shell printf "%03d%03d" $(shell $(GO) version | grep -Eo '[0-9]+\.[0-9]+' | tr '.' ' ');))
207207
@if [ "$(GO_VERSION)" -lt "$(MIN_GO_VERSION)" ]; then \
208208
echo "Gitea requires Go $(MIN_GO_VERSION_STR) or greater to build. You can get it at https://go.dev/dl/"; \
209209
exit 1; \

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"type": "module",
66
"engines": {
7-
"node": ">= 14"
7+
"node": ">= 14.0.0"
88
},
99
"dependencies": {
1010
"@claviska/jquery-minicolors": "2.3.6",

0 commit comments

Comments
 (0)