Skip to content

Commit

Permalink
Merge pull request #7927 from ipfs/feat/use-correct-supported-platforms
Browse files Browse the repository at this point in the history
Set supported platforms by go-version
  • Loading branch information
Stebalien authored Feb 25, 2021
2 parents cb7b147 + 66e0f8a commit 6527675
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 4 additions & 4 deletions bin/check_version
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,27 @@ check_at_least_version() {
# We expect a version to be of form X.X.X
# if the second dot doesn't match, we consider it a prerelease

if MIN_MIN=$(expr "$MIN_VERS" : "[^.]*\.\([0-9]\+\)"); then
if MIN_MIN=$(expr "$MIN_VERS" : "[^.]*\.\([0-9][0-9]*\)"); then
# this captured digit is necessary, since expr returns code 1 if the output is empty
if expr "$MIN_VERS" : "[^.]*\.[0-9]*\([0-9]\.\|[0-9]\$\)" >/dev/null; then
MIN_PRERELEASE="0"
else
MIN_PRERELEASE="1"
fi
MIN_FIX=$(expr "$MIN_VERS" : "[^.]*\.[0-9]\+[^0-9]\+\([0-9]\+\)") || MIN_FIX="0"
MIN_FIX=$(expr "$MIN_VERS" : "[^.]*\.[0-9][0-9]*[^0-9][^0-9]*\([0-9][0-9]*\)") || MIN_FIX="0"
else
MIN_MIN="0"
MIN_PRERELEASE="0"
MIN_FIX="0"
fi
if CUR_MIN=$(expr "$CUR_VERS" : "[^.]*\.\([0-9]\+\)"); then
if CUR_MIN=$(expr "$CUR_VERS" : "[^.]*\.\([0-9][0-9]*\)"); then
# this captured digit is necessary, since expr returns code 1 if the output is empty
if expr "$CUR_VERS" : "[^.]*\.[0-9]*\([0-9]\.\|[0-9]\$\)" >/dev/null; then
CUR_PRERELEASE="0"
else
CUR_PRERELEASE="1"
fi
CUR_FIX=$(expr "$CUR_VERS" : "[^.]*\.[0-9]\+[^0-9]\+\([0-9]\+\)") || CUR_FIX="0"
CUR_FIX=$(expr "$CUR_VERS" : "[^.]*\.[0-9][0-9]*[^0-9][^0-9]*\([0-9][0-9]*\)") || CUR_FIX="0"
else
CUR_MIN="0"
CUR_PRERELEASE="0"
Expand Down
8 changes: 6 additions & 2 deletions mk/util.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ SUPPORTED_PLATFORMS += linux-arm64
SUPPORTED_PLATFORMS += linux-386
SUPPORTED_PLATFORMS += linux-amd64

SUPPORTED_PLATFORMS += darwin-386
SUPPORTED_PLATFORMS += darwin-amd64

ifeq ($(shell bin/check_go_version "1.15.0" 2>/dev/null; echo $$?),1)
SUPPORTED_PLATFORMS += darwin-386
endif
ifeq ($(shell bin/check_go_version "1.16.0" 2>/dev/null; echo $$?),0)
SUPPORTED_PLATFORMS += darwin-arm64
endif
SUPPORTED_PLATFORMS += freebsd-386
SUPPORTED_PLATFORMS += freebsd-amd64

Expand Down

0 comments on commit 6527675

Please sign in to comment.