[PATCH 3/4] runlatex.sh: Add more lines of grep output around warning/error log

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

 



>From b3f6e0806f0d4ea46bb9885df572c0c31433a17f Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@xxxxxxxxx>
Date: Sun, 12 Mar 2017 20:42:10 +0900
Subject: [PATCH 3/4] runlatex.sh: Add more lines of grep output around warning/error log

This change will make it mostly unnecessary to look up log file
when build error occurred.

Also fix an iteration status message to match that in the log file.

Signed-off-by: Akira Yokosawa <akiyks@xxxxxxxxx>
---
 utilities/runfirstlatex.sh | 1 +
 utilities/runlatex.sh      | 7 +++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/utilities/runfirstlatex.sh b/utilities/runfirstlatex.sh
index dc55cb7..8261238 100644
--- a/utilities/runfirstlatex.sh
+++ b/utilities/runfirstlatex.sh
@@ -43,6 +43,7 @@ echo "pdflatex 1 for $basename.pdf"
 pdflatex $basename > /dev/null 2>&1 < /dev/null || :
 if grep -q '! Emergency stop.' $basename.log
 then
+	grep -B 15 -A 5 '! Emergency stop.' $basename.log
 	echo "----- Fatal latex error, see $basename.log for details. -----"
 	exit 1
 fi
diff --git a/utilities/runlatex.sh b/utilities/runlatex.sh
index da9e82d..e6b3938 100644
--- a/utilities/runlatex.sh
+++ b/utilities/runlatex.sh
@@ -43,6 +43,7 @@ iterate_latex () {
 	pdflatex $basename > /dev/null 2>&1 < /dev/null || :
 	if grep -q '! Emergency stop.' $basename.log
 	then
+		grep -B 15 -A 5 '! Emergency stop.' $basename.log
 		echo "----- Fatal latex error, see $basename.log for details. -----"
 		exit 1
 	fi
@@ -98,11 +99,13 @@ do
 		fi
 	fi
 	iter=`expr $iter + 1`
-	echo "pdflatex $iter for $basename.pdf # label(s) may have been changed"
+	echo "pdflatex $iter for $basename.pdf # label(s) may have changed"
 	iterate_latex
 done
-if grep "LaTeX Warning:" $basename.log
+if grep -q "LaTeX Warning:" $basename.log
 then
+	echo "----- Excerpt around remaining warning messages -----"
+	grep -B 8 -A 5 "LaTeX Warning:" $basename.log | tee $basename-warning.log
 	echo "----- You can see $basename-warning.log for the warnings above. -----"
 	echo "----- If you need to, see $basename.log for details. -----"
 	rm -f $basename-warning-prev.log
-- 
2.7.4


--
To unsubscribe from this list: send the line "unsubscribe perfbook" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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