]> source.dussan.org Git - gitea.git/commitdiff
Fix versions check for busybox `sh` (#20358)
authorsilverwind <me@silverwind.io>
Thu, 14 Jul 2022 08:58:14 +0000 (10:58 +0200)
committerGitHub <noreply@github.com>
Thu, 14 Jul 2022 08:58:14 +0000 (16:58 +0800)
`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.

Makefile
package-lock.json
package.json

index 41d39b4c323283f0b8d9fbd058b0a12e9b8168ef..5536788613c4f6bd0c67c49d8b3861b6eb488903 100644 (file)
--- 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; \
index 411a22037d12e447a58f712c6b3c4ef6beb103f6..5032e50fc5250410555936fa47ad84a4cfb27d93 100644 (file)
@@ -61,7 +61,7 @@
         "updates": "13.0.5"
       },
       "engines": {
-        "node": ">= 14"
+        "node": ">= 14.0.0"
       }
     },
     "node_modules/@ampproject/remapping": {
index 1ec816fc569d6fa4a754f00691a6819e9a4d509d..b55da05b3dec06c7add8ff827b36f94c7f2a37d8 100644 (file)
@@ -4,7 +4,7 @@
   "private": true,
   "type": "module",
   "engines": {
-    "node": ">= 14"
+    "node": ">= 14.0.0"
   },
   "dependencies": {
     "@claviska/jquery-minicolors": "2.3.6",