From 2c85e0a498ee91895b310ae3a9c83f32a0d0d90f Mon Sep 17 00:00:00 2001 From: Ryan Schmidt Date: Mon, 27 Aug 2018 20:54:58 -0500 Subject: [PATCH] Use "command -v" instead of "which" The behavior of "which" is not standardized by POSIX. Some old implementations print their error messages to stdout instead of stderr, and don't return a nonzero exit code when they fail to find the given program. "command -v" on the other hand is in POSIX (optional in 2004 and required as of 2008). Remove otherwise-unused variables AUTORECONF and GTKDOCIZE. --- autogen.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/autogen.sh b/autogen.sh index 9e4ba4c39..7c8c306d8 100755 --- a/autogen.sh +++ b/autogen.sh @@ -7,8 +7,7 @@ test -n "$srcdir" || srcdir=. olddir=`pwd` cd "$srcdir" -GTKDOCIZE=$(which gtkdocize 2>/dev/null) -if test -z $GTKDOCIZE; then +if ! command -v gtkdocize >/dev/null 2>&1; then echo "You don't have gtk-doc installed, and thus won't be able to generate the documentation." rm -f gtk-doc.make cat > gtk-doc.make </dev/null 2>&1; then echo "*** No autoreconf found, please install it ***" exit 1 fi