Skip to content

Commit 7afa7b9

Browse files
concatimejasnell
authored andcommittedMay 21, 2021
build: replace non-POSIX test -a|o
test/[ from sbase unix tools[1] throws "too many arguments" if -a or -o is provided. The syntax has been marked obsolescent as per the manual[2]. [1] http://core.suckless.org/sbase/ [2] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html#tag_20_128_16 PR-URL: nodejs#38731 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
1 parent a1f590e commit 7afa7b9

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed
 

‎Makefile

+6-6
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ $(NODE_EXE): build_type:=Release
103103
$(NODE_G_EXE): build_type:=Debug
104104
$(NODE_EXE) $(NODE_G_EXE): config.gypi out/Makefile
105105
$(MAKE) -C out BUILDTYPE=${build_type} V=$(V)
106-
if [ ! -r $@ -o ! -L $@ ]; then \
106+
if [ ! -r $@ ] || [ ! -L $@ ]; then \
107107
ln -fs out/${build_type}/$(NODE_EXE) $@; fi
108108
else
109109
ifeq ($(BUILD_WITH), ninja)
@@ -117,11 +117,11 @@ else
117117
endif
118118
$(NODE_EXE): config.gypi out/Release/build.ninja
119119
ninja -C out/Release $(NINJA_ARGS)
120-
if [ ! -r $@ -o ! -L $@ ]; then ln -fs out/Release/$(NODE_EXE) $@; fi
120+
if [ ! -r $@ ] || [ ! -L $@ ]; then ln -fs out/Release/$(NODE_EXE) $@; fi
121121

122122
$(NODE_G_EXE): config.gypi out/Debug/build.ninja
123123
ninja -C out/Debug $(NINJA_ARGS)
124-
if [ ! -r $@ -o ! -L $@ ]; then ln -fs out/Debug/$(NODE_EXE) $@; fi
124+
if [ ! -r $@ ] || [ ! -L $@ ]; then ln -fs out/Debug/$(NODE_EXE) $@; fi
125125
else
126126
$(NODE_EXE) $(NODE_G_EXE):
127127
$(warning This Makefile currently only supports building with 'make' or 'ninja')
@@ -908,7 +908,7 @@ BINARYTAR=$(BINARYNAME).tar
908908
HAS_XZ ?= $(shell command -v xz > /dev/null 2>&1; [ $$? -eq 0 ] && echo 1 || echo 0)
909909
# Supply SKIP_XZ=1 to explicitly skip .tar.xz creation
910910
SKIP_XZ ?= 0
911-
XZ = $(shell [ $(HAS_XZ) -eq 1 -a $(SKIP_XZ) -eq 0 ] && echo 1 || echo 0)
911+
XZ = $(shell [ $(HAS_XZ) -eq 1 ] && [ $(SKIP_XZ) -eq 0 ] && echo 1 || echo 0)
912912
XZ_COMPRESSION ?= 9e
913913
PKG=$(TARNAME).pkg
914914
MACOSOUTDIR=out/macos
@@ -949,7 +949,7 @@ release-only: check-xz
949949
echo "" >&2 ; \
950950
exit 1 ; \
951951
fi
952-
@if [ "$(DISTTYPE)" != "release" -o "$(RELEASE)" = "1" ]; then \
952+
@if [ "$(DISTTYPE)" != "release" ] || [ "$(RELEASE)" = "1" ]; then \
953953
exit 0; \
954954
else \
955955
echo "" >&2 ; \
@@ -958,7 +958,7 @@ release-only: check-xz
958958
echo "" >&2 ; \
959959
exit 1 ; \
960960
fi
961-
@if [ "$(RELEASE)" = "0" -o -f "$(CHANGELOG)" ]; then \
961+
@if [ "$(RELEASE)" = "0" ] || [ -f "$(CHANGELOG)" ]; then \
962962
exit 0; \
963963
else \
964964
echo "" >&2 ; \

‎android-configure

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export CXX_host=$(command -v g++)
5656
host_gcc_version=$($CC_host --version | grep gcc | awk '{print $NF}')
5757
major=$(echo $host_gcc_version | awk -F . '{print $1}')
5858
minor=$(echo $host_gcc_version | awk -F . '{print $2}')
59-
if [ -z $major ] || [ -z $minor ] || [ $major -lt 6 ] || [ $major -eq 6 -a $minor -lt 3 ]; then
59+
if [ -z $major ] || [ -z $minor ] || [ $major -lt 6 ] || ( [ $major -eq 6 ] && [ $minor -lt 3 ] ); then
6060
echo "host gcc $host_gcc_version is too old, need gcc 6.3.0"
6161
return 1
6262
fi

0 commit comments

Comments
 (0)
Please sign in to comment.