summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz93@gmail.com>2023-12-13 00:01:39 -0500
committerIlmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>2024-01-22 14:01:17 +0100
commit71fed56e4a09fbf141fdb8f064df6764e6e6d262 (patch)
tree18826fdfd7ce2ce6868ad8fc52418e7a0b553eac /connectivity
parenta1c854fffe0bf0f177535df320b60a328530ac70 (diff)
use portable "command -v" to detect installed programs, part 2
The "which" utility is not guaranteed to be installed either, and if it is, its behavior is not portable either. This means that when various programs are installed, the `which` check will report a fatal error because the which tool did not exist and the shell returned a nonzero status when attempting to fork+exec. If it did exist, it might not be an implementation of `which` that returns nonzero when commands do not exist. The general scripting suggestion is to use the "command -v" shell builtin; this is required to exist in all POSIX 2008 compliant shells, and is thus guaranteed to work everywhere. For some in-depth discussions on the topic, see: - https://mywiki.wooledge.org/BashFAQ/081 - https://unix.stackexchange.com/questions/85249/why-not-use-which-what-to-use-then/85250#85250 Examples of open-source shells likely to be installed as /bin/sh on Linux, which implement the 15-year-old standard: ash, bash, busybox, dash, ksh, mksh and zsh. This commit updates the build system to configure and build correctly on systems without `which`. Change-Id: I23dbde5c7f104dd610fd5f78c82bf9a7d0cc1930 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160663 Tested-by: Jenkins Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Diffstat (limited to 'connectivity')
0 files changed, 0 insertions, 0 deletions