make test-instance Support for MacOS & different architectures #450

Merged
6543 merged 3 commits from 6543/go-sdk:make_test-instance into master 2020-11-09 20:55:00 +00:00
Showing only changes of commit 4ec30903a7 - Show all commits

View File

@ -11,22 +11,23 @@ GITEA_DL := https://dl.gitea.io/gitea/master/gitea-master-
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
GITEA_DL := $(GITEA_DL)linux-
UNAME_P := $(shell uname -p)
ifeq ($(UNAME_P),unknown)
GITEA_DL := $(GITEA_DL)amd64
endif
6543 marked this conversation as resolved Outdated

uname -p is not reliable for Mac. It will show i386 but it is not. Also we don't have 386 binary for mac so it fails:

--2020-11-09 13:31:36--  https://dl.gitea.io/gitea/master/gitea-master-darwin-10.6-386
Resolving dl.gitea.io (dl.gitea.io)... 147.75.84.81, 2604:1380:2000:c600::5
Connecting to dl.gitea.io (dl.gitea.io)|147.75.84.81|:443... connected.
HTTP request sent, awaiting response... 404 Not Found

Mac should always be gitea-master-darwin-10.6-amd64

```uname -p ``` is not reliable for Mac. It will show i386 but it is not. Also we don't have 386 binary for mac so it fails: ```wget --2020-11-09 13:31:36-- https://dl.gitea.io/gitea/master/gitea-master-darwin-10.6-386 Resolving dl.gitea.io (dl.gitea.io)... 147.75.84.81, 2604:1380:2000:c600::5 Connecting to dl.gitea.io (dl.gitea.io)|147.75.84.81|:443... connected. HTTP request sent, awaiting response... 404 Not Found ``` Mac should always be gitea-master-darwin-10.6-amd64
ifeq ($(UNAME_P),x86_64)
GITEA_DL := $(GITEA_DL)amd64
endif
ifneq ($(filter %86,$(UNAME_P)),)
GITEA_DL := $(GITEA_DL)386
endif
ifneq ($(filter arm%,$(UNAME_P)),)
GITEA_DL := $(GITEA_DL)arm-5
endif
endif
ifeq ($(UNAME_S),Darwin)
GITEA_DL := $(GITEA_DL)darwin-10.6-
endif
UNAME_P := $(shell uname -p)
ifeq ($(UNAME_P),unknown)
GITEA_DL := $(GITEA_DL)amd64
endif
ifeq ($(UNAME_P),x86_64)
GITEA_DL := $(GITEA_DL)amd64
endif
ifneq ($(filter %86,$(UNAME_P)),)
GITEA_DL := $(GITEA_DL)386
endif
ifneq ($(filter arm%,$(UNAME_P)),)
GITEA_DL := $(GITEA_DL)arm-5
GITEA_DL := $(GITEA_DL)darwin-10.6-amd64
endif
.PHONY: all