Skip to content

Commit 9fd8bcd

Browse files
concatimerichardlau
authored andcommitted
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: #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 181ab86 commit 9fd8bcd

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ $(NODE_EXE): build_type:=Release
102102
$(NODE_G_EXE): build_type:=Debug
103103
$(NODE_EXE) $(NODE_G_EXE): config.gypi out/Makefile
104104
$(MAKE) -C out BUILDTYPE=${build_type} V=$(V)
105-
if [ ! -r $@ -o ! -L $@ ]; then \
105+
if [ ! -r $@ ] || [ ! -L $@ ]; then \
106106
ln -fs out/${build_type}/$(NODE_EXE) $@; fi
107107
else
108108
ifeq ($(BUILD_WITH), ninja)
@@ -116,11 +116,11 @@ else
116116
endif
117117
$(NODE_EXE): config.gypi out/Release/build.ninja
118118
ninja -C out/Release $(NINJA_ARGS)
119-
if [ ! -r $@ -o ! -L $@ ]; then ln -fs out/Release/$(NODE_EXE) $@; fi
119+
if [ ! -r $@ ] || [ ! -L $@ ]; then ln -fs out/Release/$(NODE_EXE) $@; fi
120120

121121
$(NODE_G_EXE): config.gypi out/Debug/build.ninja
122122
ninja -C out/Debug $(NINJA_ARGS)
123-
if [ ! -r $@ -o ! -L $@ ]; then ln -fs out/Debug/$(NODE_EXE) $@; fi
123+
if [ ! -r $@ ] || [ ! -L $@ ]; then ln -fs out/Debug/$(NODE_EXE) $@; fi
124124
else
125125
$(NODE_EXE) $(NODE_G_EXE):
126126
$(warning This Makefile currently only supports building with 'make' or 'ninja')
@@ -906,7 +906,7 @@ BINARYTAR=$(BINARYNAME).tar
906906
HAS_XZ ?= $(shell command -v xz > /dev/null 2>&1; [ $$? -eq 0 ] && echo 1 || echo 0)
907907
# Supply SKIP_XZ=1 to explicitly skip .tar.xz creation
908908
SKIP_XZ ?= 0
909-
XZ = $(shell [ $(HAS_XZ) -eq 1 -a $(SKIP_XZ) -eq 0 ] && echo 1 || echo 0)
909+
XZ = $(shell [ $(HAS_XZ) -eq 1 ] && [ $(SKIP_XZ) -eq 0 ] && echo 1 || echo 0)
910910
XZ_COMPRESSION ?= 9e
911911
PKG=$(TARNAME).pkg
912912
MACOSOUTDIR=out/macos
@@ -947,7 +947,7 @@ release-only: check-xz
947947
echo "" >&2 ; \
948948
exit 1 ; \
949949
fi
950-
@if [ "$(DISTTYPE)" != "release" -o "$(RELEASE)" = "1" ]; then \
950+
@if [ "$(DISTTYPE)" != "release" ] || [ "$(RELEASE)" = "1" ]; then \
951951
exit 0; \
952952
else \
953953
echo "" >&2 ; \
@@ -956,7 +956,7 @@ release-only: check-xz
956956
echo "" >&2 ; \
957957
exit 1 ; \
958958
fi
959-
@if [ "$(RELEASE)" = "0" -o -f "$(CHANGELOG)" ]; then \
959+
@if [ "$(RELEASE)" = "0" ] || [ -f "$(CHANGELOG)" ]; then \
960960
exit 0; \
961961
else \
962962
echo "" >&2 ; \

android-configure

Lines changed: 1 addition & 1 deletion
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)