Skip to content

Commit 1e22626

Browse files
davazpstassats
authored andcommitted
Do not rely on which to be present in the system
For portability, it is better to use the built-in `command` to check the existance of executables in the system.
1 parent a61d893 commit 1e22626

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

doc/manual/make-tempfiles.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ then
2727
SBCL_HOME=$SBCL_PWD/../../obj/sbcl-home/; export SBCL_HOME
2828
SBCL_BUILDING_CONTRIB="please asdf install your hook"; export SBCL_BUILDING_CONTRIB
2929
else
30-
SBCLRUNTIME="`which sbcl`"
30+
SBCLRUNTIME="`command -v sbcl`"
3131
fi
3232
else
3333
SBCLRUNTIME="$1"

find-gnumake.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ find_gnumake() {
88
GNUMAKE="$GNUMAKE"
99
elif [ "GNU Make" = "`make -v 2>/dev/null | head -n 1 | cut -b 1-8`" ]; then
1010
GNUMAKE=make
11-
elif [ -x "`which gmake`" ] ; then
11+
elif [ -x "`command -v gmake`" ] ; then
1212
# "gmake" is the preferred name in *BSD.
1313
GNUMAKE=gmake
14-
elif [ -x "`which gnumake`" ] ; then
14+
elif [ -x "`command -v gnumake`" ] ; then
1515
# MacOS X aka Darwin
1616
GNUMAKE=gnumake
1717
else

generate-version.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
git_available_p() {
44
# Check that (1) we have git (2) this is a git tree.
5-
if ( which git >/dev/null 2>/dev/null && git describe >/dev/null 2>/dev/null )
5+
if ( command -v git >/dev/null && git describe >/dev/null 2>/dev/null )
66
then
77
echo "ok"
88
else

make-target-contrib.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ LC_ALL=C
2222
# Just doing CC=${CC:-cc} may be enough, but it needs to be checked
2323
# that cc is available on all platforms.
2424
if [ -z $CC ]; then
25-
if [ -x "`which cc`" ]; then
25+
if [ -x "`command -v cc`" ]; then
2626
CC=cc
2727
else
2828
CC=gcc

tests/run-compiler.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
platform="${SBCL_SOFTWARE_TYPE}-${SBCL_MACHINE_TYPE}"
44

55
if [ -z $CC ]; then
6-
if [ -x "`which cc`" ]; then
6+
if [ -x "`command -v cc`" ]; then
77
CC=cc
88
else
99
CC=gcc

0 commit comments

Comments
 (0)