build-gnu.sh: Cleanup logic for system bins

This commit is contained in:
oech3
2025-11-13 06:13:43 +09:00
committed by GitHub
parent d17e89bdfe
commit 9887a3c9bb
+2 -18
View File
@@ -39,24 +39,8 @@ path_GNU="$("${READLINK}" -fm -- "${path_GNU:-${path_UUTILS}/../gnu}")"
###
# On MacOS there is no system /usr/bin/timeout
# and trying to add it to /usr/bin (with symlink of copy binary) will fail unless system integrity protection is disabled (not ideal)
# ref: https://support.apple.com/en-us/102149
# On MacOS the Homebrew coreutils could be installed and then "sudo ln -s /opt/homebrew/bin/timeout /usr/local/bin/timeout"
# Set to /usr/local/bin/timeout instead if /usr/bin/timeout is not found
SYSTEM_TIMEOUT="timeout"
if [ -x /usr/bin/timeout ]; then
SYSTEM_TIMEOUT="/usr/bin/timeout"
elif [ -x /usr/local/bin/timeout ]; then
SYSTEM_TIMEOUT="/usr/local/bin/timeout"
fi
SYSTEM_YES="yes"
if [ -x /usr/bin/yes ]; then
SYSTEM_YES="/usr/bin/yes"
elif [ -x /usr/local/bin/yes ]; then
SYSTEM_YES="/usr/local/bin/yes"
fi
SYSTEM_TIMEOUT=$(command -v timeout)
SYSTEM_YES=$(command -v yes)
###