Discussions of the Parallel Programming book
 help / color / mirror / Atom feed
* [PATCH] precheck-tentative.sh: Make array.sty probing fail-fast and deterministic
@ 2026-05-07  9:50 Kunwu Chan
  2026-05-07 10:37 ` Akira Yokosawa
  0 siblings, 1 reply; 3+ messages in thread
From: Kunwu Chan @ 2026-05-07  9:50 UTC (permalink / raw)
  To: perfbook; +Cc: Kunwu Chan, Kunwu Chan

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 <kunwu.chan@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-05-07 17:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-07  9:50 [PATCH] precheck-tentative.sh: Make array.sty probing fail-fast and deterministic Kunwu Chan
2026-05-07 10:37 ` Akira Yokosawa
2026-05-07 17:52   ` Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox