diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2020-04-19 03:23:58 -0400 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2020-05-25 19:24:28 +0200 |
commit | b21556d28b7be3921fa99089c61a7938811e25d1 (patch) | |
tree | ab5e0aa154bffbeddf6fc0cfb65ecbe7c94ef82b /configure | |
parent | 5e4c025567c688f3e7bd1d253619edafafbb7fcf (diff) | |
download | node-new-b21556d28b7be3921fa99089c61a7938811e25d1.tar.gz |
build: fix inability to detect correct python command in configure
The "which" utility is not guaranteed to be installed, and if it is, its
behavior is not portable.
Conversely, the "command -v" shell builtin is required to exist in all
POSIX 2008 compliant shells, and is thus guaranteed to work everywhere.
Examples of open-source shells likely to be installed as /bin/sh on
Linux, which implement the 12-year-old standard: ash, bash, busybox,
dash, ksh, mksh and zsh.
Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
PR-URL: https://github.com/nodejs/node/pull/32925
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -5,11 +5,11 @@ # as is the fact that the ] goes on a new line. _=[ 'exec' '/bin/sh' '-c' ''' test ${FORCE_PYTHON2} && exec python2 "$0" "$@" # workaround for gclient -which python3.8 >/dev/null && exec python3.8 "$0" "$@" -which python3.7 >/dev/null && exec python3.7 "$0" "$@" -which python3.6 >/dev/null && exec python3.6 "$0" "$@" -which python3.5 >/dev/null && exec python3.5 "$0" "$@" -which python2.7 >/dev/null && exec python2.7 "$0" "$@" +command -v python3.8 >/dev/null && exec python3.8 "$0" "$@" +command -v python3.7 >/dev/null && exec python3.7 "$0" "$@" +command -v python3.6 >/dev/null && exec python3.6 "$0" "$@" +command -v python3.5 >/dev/null && exec python3.5 "$0" "$@" +command -v python2.7 >/dev/null && exec python2.7 "$0" "$@" exec python "$0" "$@" ''' "$0" "$@" ] |