diff options
author | Martin Roth <martinroth@google.com> | 2017-06-15 11:37:26 -0600 |
---|---|---|
committer | Nico Huber <nico.h@gmx.de> | 2017-06-25 08:45:05 +0000 |
commit | d55f5ebe44ece4532ea28fe2c30a60bac8a7e81f (patch) | |
tree | 56dbf6e35dbda3f21b9396638c3766cbe2507c54 /util/crossgcc | |
parent | 72dc21cb7c93a25d2b0a473a65bb02462eeef163 (diff) |
crossgcc/buildgcc: update file location code
- Change from 'which' to 'command -v'. 'which' is not a posix command.
Change-Id: Icdf18e7e496447157554b8e61b1528f03456536d
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/20230
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Diffstat (limited to 'util/crossgcc')
-rwxr-xr-x | util/crossgcc/buildgcc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc index b388afbebe..4d1f25a6a0 100755 --- a/util/crossgcc/buildgcc +++ b/util/crossgcc/buildgcc @@ -152,7 +152,7 @@ searchtool() search="$2" fi for i in "$1" "g$1" "gnu$1"; do - if [ -x "$(which $i 2>/dev/null)" ]; then + if [ -x "$(command -v $i 2>/dev/null)" ]; then if [ "$(cat /dev/null | $i --version 2>&1 | grep -c "$search")" \ -gt 0 ]; then echo $i @@ -164,7 +164,7 @@ searchtool() # patch and tar also work. if [ $UNAME = "Darwin" -o $UNAME = "FreeBSD" -o $UNAME = "NetBSD" -o $UNAME = "OpenBSD" ]; then if [ "$1" = "patch" -o "$1" = "tar" ]; then - if [ -x "$(which $1 2>/dev/null)" ]; then + if [ -x "$(command -v $1 2>/dev/null)" ]; then echo $1 return fi @@ -172,19 +172,19 @@ searchtool() fi if echo $1 | grep -q "sum" ; then algor=$(echo $1 | sed -e 's,sum,,') - if [ -x "$(which $1 2>/dev/null)" ]; then + if [ -x "$(command -v $1 2>/dev/null)" ]; then #xxxsum [file] echo $1 return - elif [ -x "$(which $algor 2>/dev/null)" ]; then + elif [ -x "$(command -v $algor 2>/dev/null)" ]; then #xxx [file] echo $algor return - elif [ -x "$(which openssl 2>/dev/null)" ]; then + elif [ -x "$(command -v openssl 2>/dev/null)" ]; then #openssl xxx [file] echo openssl $algor return - elif [ -x "$(which cksum 2>/dev/null)" ]; then + elif [ -x "$(command -v cksum 2>/dev/null)" ]; then #cksum -a xxx [file] #cksum has special options in NetBSD. Actually, NetBSD will use the second case above. echo "buildgcc" | cksum -a $algor > /dev/null 2>/dev/null && \ |