[PATCH] precheck-tentative.sh: Make array.sty probing fail-fast and deterministic
Kunwu Chan <[email protected]> Thu, 7 May 2026 17:50:11 +0800
| Newsgroups | org.kernel.vger.perfbook |
|---|---|
| Message-ID | <[email protected]> |
On systems where kpsewhich cannot resolve array.sty, the script fed an
empty path into the version-parsing pipeline and then compared an empty
array_req_ver against latex_ver in the non-pdflatex-dev path. The
result depended on environment and produced no actionable error.
This is reproducible by overriding kpsewhich to return nothing for
array.sty while keeping other lookups intact.
Add a guard before parsing array.sty, set array_req_ver only when the
file exists, fail fast with a clear diagnostic when it does not, and
correct the warning text typo ("arary.sty" -> "array.sty").
Fixes: 4cad3dd1174a ("precheck-tentative.sh: Fail early with suggestions for Fedora 44")
Signed-off-by: Kunwu Chan <[email protected]>
---
utilities/precheck-tentative.sh | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/utilities/precheck-tentative.sh b/utilities/precheck-tentative.sh
index 96d2fe2f..1e106877 100755
--- a/utilities/precheck-tentative.sh
+++ b/utilities/precheck-tentative.sh
@@ -77,15 +77,24 @@ if [ "$latex_release_dev" != "" ] ; then
fi
array_sty=`kpsewhich array.sty`
-array_req_ver=`grep -F -e '\NeedsTeXFormat{LaTeX2e}' $array_sty | \
- tail -n 1 | \
- sed -e 's/\\\\NeedsTeXFormat{LaTeX2e}//' | \
- sed -E -e 's/\[/</' -e 's/\]/>/' -e 's/\//\-/g'`
+if [ "$array_sty" != "" ] ; then
+ array_req_ver=`grep -F -e '\NeedsTeXFormat{LaTeX2e}' $array_sty | \
+ tail -n 1 | \
+ sed -e 's/\\\\NeedsTeXFormat{LaTeX2e}//' | \
+ sed -E -e 's/\[/</' -e 's/\]/>/' -e 's/\//\-/g'`
+else
+ array_req_ver=""
+fi
if [ "$LATEX" != "pdflatex-dev" ] ; then
+ if [ "$array_req_ver" = "" ] ; then
+ echo "array.sty is not found!"
+ echo "Check your TeX Live installation."
+ exit 1
+ fi
if [ "$array_req_ver" \> "$latex_ver" -a "$WARNEXIT" = "1" ] ; then
echo "#### array.sty requires a later release of LaTeX2e. ####"
- echo "#### arary.sty requires LaTeX2e $array_req_ver, ####"
+ echo "#### array.sty requires LaTeX2e $array_req_ver, ####"
echo "#### while your LaTeX2e is $latex_ver. ####"
echo "#### Check your TeX Live installation. (Known issue under Fedora 44.)"
echo "#### 1st option is to downgrade array.sty to v2.6n."
--
2.25.1