[PATCH -perfbook v2] utilities/autodate.sh: Fix potential hung-up on missing tcolorbox

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"kpsewhich tcolorbox.sty" can be empty if tcolorbox is not
available.

If this is the case, "grep" in `grep ProvidePackage | sed ...`
will wait forever.

Add an empty check in front of "grep" with exit code of 1.

Fixes: b2f19231bcc5 ("utilities/autodate.sh: Make newer tcolorbox behave as before")
Signed-off-by: Akira Yokosawa <akiyks@xxxxxxxxx>
---
Change since v1:

o Fix string comparison operator of shell script ("=")

--
utilities/autodate.sh | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/utilities/autodate.sh b/utilities/autodate.sh
index 7bd7cbb8..acf3b051 100644
--- a/utilities/autodate.sh
+++ b/utilities/autodate.sh
@@ -97,6 +97,13 @@ env printf '\\IfQqzBg{}{\\setboolean{qqzbg}{%s}}\n' $qqzbg
 
 # command for newer tcolorbox (4.40 or later) to have backward-compatible skips
 tcolorbox_sty=`kpsewhich tcolorbox.sty`
+
+if [ "$tcolorbox_sty" = "" ]
+then
+	echo "Error: package 'tcolorbox' not found. See See #9 in FAQ-BUILD.txt" >&2
+	exit 1
+fi
+
 tcbversion=`grep ProvidesPackage $tcolorbox_sty | sed -e 's/.*version \([0-9]\+\.[0-9]\+\).*/\1/g'`
 tcbold=4.39
 env printf '%% tcolorbox version: %s\n' $tcbversion
-- 
2.17.1





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux