summaryrefslogtreecommitdiff
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:13:37 +0100
commitceb885232aa09444142ad9a70e9f6947ca1d70e0 (patch)
tree90980504cfb278b2cecffb07d8ca834f9baf40bb
parent2a5ff80264825e21adb5ff107a3d01237b86f559 (diff)
use portable "command -v" to detect installed programs, part 5
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 documentation to no longer suggest a bad practice that will confuse the reader when it doesn't work. Change-Id: I0ed5ced353124919c7e09912c6d4d5aea146fa33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160666 Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
-rw-r--r--solenv/doc/gbuild/doxygen.cfg2
-rw-r--r--solenv/inc/doxygen.cfg4
-rw-r--r--solenv/inc/doxygen_doc.cfg6
-rw-r--r--solenv/inc/doxygen_tag.cfg4
-rw-r--r--writerfilter/documentation/doxygen/Doxyfile2
5 files changed, 9 insertions, 9 deletions
diff --git a/solenv/doc/gbuild/doxygen.cfg b/solenv/doc/gbuild/doxygen.cfg
index d66fe0cd1670..605432ab1167 100644
--- a/solenv/doc/gbuild/doxygen.cfg
+++ b/solenv/doc/gbuild/doxygen.cfg
@@ -1661,7 +1661,7 @@ EXTERNAL_GROUPS = YES
EXTERNAL_PAGES = YES
# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of `which perl').
+# interpreter (i.e. the result of `command -v perl').
PERL_PATH = /usr/bin/perl
diff --git a/solenv/inc/doxygen.cfg b/solenv/inc/doxygen.cfg
index ed50d426549e..ea6ec026d1d5 100644
--- a/solenv/inc/doxygen.cfg
+++ b/solenv/inc/doxygen.cfg
@@ -2085,7 +2085,7 @@ EXTERNAL_GROUPS = YES
EXTERNAL_PAGES = YES
# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of 'which perl').
+# interpreter (i.e. the result of 'command -v perl').
# The default file (with absolute path) is: /usr/bin/perl.
PERL_PATH =
@@ -2300,7 +2300,7 @@ DOT_IMAGE_FORMAT = svg
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
-INTERACTIVE_SVG = YES
+INTERACTIVE_SVG = YES
# The DOT_PATH tag can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found in the path.
diff --git a/solenv/inc/doxygen_doc.cfg b/solenv/inc/doxygen_doc.cfg
index 78d2778f7a4b..a53a3791c989 100644
--- a/solenv/inc/doxygen_doc.cfg
+++ b/solenv/inc/doxygen_doc.cfg
@@ -2085,7 +2085,7 @@ EXTERNAL_GROUPS = YES
EXTERNAL_PAGES = YES
# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of 'which perl').
+# interpreter (i.e. the result of 'command -v perl').
# The default file (with absolute path) is: /usr/bin/perl.
PERL_PATH =
@@ -2300,7 +2300,7 @@ DOT_IMAGE_FORMAT = svg
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
-INTERACTIVE_SVG = YES
+INTERACTIVE_SVG = YES
# The DOT_PATH tag can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found in the path.
@@ -2398,4 +2398,4 @@ GENERATE_LEGEND = YES
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
-DOT_CLEANUP = YES \ No newline at end of file
+DOT_CLEANUP = YES
diff --git a/solenv/inc/doxygen_tag.cfg b/solenv/inc/doxygen_tag.cfg
index 1ba9c17cdbfc..803ec974982d 100644
--- a/solenv/inc/doxygen_tag.cfg
+++ b/solenv/inc/doxygen_tag.cfg
@@ -2085,7 +2085,7 @@ EXTERNAL_GROUPS = YES
EXTERNAL_PAGES = YES
# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of 'which perl').
+# interpreter (i.e. the result of 'command -v perl').
# The default file (with absolute path) is: /usr/bin/perl.
PERL_PATH =
@@ -2300,7 +2300,7 @@ DOT_IMAGE_FORMAT = svg
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
-INTERACTIVE_SVG = YES
+INTERACTIVE_SVG = YES
# The DOT_PATH tag can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found in the path.
diff --git a/writerfilter/documentation/doxygen/Doxyfile b/writerfilter/documentation/doxygen/Doxyfile
index 15414b8287c6..6ae1ac4c02aa 100644
--- a/writerfilter/documentation/doxygen/Doxyfile
+++ b/writerfilter/documentation/doxygen/Doxyfile
@@ -1078,7 +1078,7 @@ ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of `which perl').
+# interpreter (i.e. the result of `command -v perl').
PERL_PATH = /usr/bin/perl