Skip to content

Commit ad9d643

Browse files
committed
Makefile: Use a POSIX-compatible test ('==' -> '=')
With dash 0.5.7: # make docs /bin/sh: 1: test: 1.3.3: unexpected operator /bin/sh: 1: test: 1.3.3: unexpected operator /bin/sh: 1: test: 1.3.3: unexpected operator Makefile:47: *** cannot build output//oci-runtime-spec.pdf without either pandoc or docker. Stop. # command -V test test is a shell builtin POSIX defines '=' for string comparison [1]; the '==' form is a Bashism. SHELL was added in f3fdf03 (Makefile: prefer bash, 2016-05-25, #455) to avoid these "unexpected operator" errors, but there's no reason to require Bash when we can make the comparison's POSIX compliant. [1]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html Signed-off-by: W. Trevor King <[email protected]>
1 parent 069e8e1 commit ad9d643

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
EPOCH_TEST_COMMIT := 78e6667ae2d67aad100b28ee9580b41b7a24e667
33
OUTPUT_DIRNAME ?= output/
44
DOC_FILENAME ?= oci-runtime-spec
5-
SHELL ?= $(shell command -v bash 2>/dev/null)
65
DOCKER ?= $(shell command -v docker 2>/dev/null)
76
PANDOC ?= $(shell command -v pandoc 2>/dev/null)
87
ifeq "$(strip $(PANDOC))" ''
@@ -63,7 +62,7 @@ version.md: ./specs-go/version.go
6362

6463
HOST_GOLANG_VERSION = $(shell go version | cut -d ' ' -f3 | cut -c 3-)
6564
# this variable is used like a function. First arg is the minimum version, Second arg is the version to be checked.
66-
ALLOWED_GO_VERSION = $(shell test '$(shell /bin/echo -e "$(1)\n$(2)" | sort -V | head -n1)' == '$(1)' && echo 'true')
65+
ALLOWED_GO_VERSION = $(shell test '$(shell /bin/echo -e "$(1)\n$(2)" | sort -V | head -n1)' = '$(1)' && echo 'true')
6766

6867
.PHONY: test .govet .golint .gitvalidation
6968

0 commit comments

Comments
 (0)