summaryrefslogtreecommitdiff
path: root/patches/latexrun-pull-62
blob: 6c42f86ad1a5d156a6e535cc27215546a5720e4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
--- latexrun
+++ latexrun
@@ -965,7 +965,7 @@ class LaTeX(Task):
 
     def __clean_messages(self, msgs):
         """Make some standard log messages more user-friendly."""
-        have_undefined_reference = False
+        has_errors = any(msg.typ == 'error' for msg in msgs)
         for msg in msgs:
             if msg.msg == '==> Fatal error occurred, no output PDF file produced!':
                 msg = msg._replace(typ='info',
@@ -973,10 +973,15 @@ class LaTeX(Task):
             if msg.msg.startswith('[LaTeX] '):
                 # Strip unnecessary package name
                 msg = msg._replace(msg=msg.msg.split(' ', 1)[1])
-            if re.match(r'Reference .* undefined', msg.msg):
-                have_undefined_reference = True
-            if have_undefined_reference and \
-               re.match(r'There were undefined references', msg.msg):
+            if has_errors and re.match(
+                r'.*[Rr]erun to get .* right|.* on page .* undefined', msg.msg
+            ):
+                # Warnings on undefined references may occur in high
+                # numbers when documents fail to build.
+                continue
+            if re.match(
+                r"There were (multiply-defined labels|undefined references)", msg.msg
+            ):
                 # LaTeX prints this at the end so the user knows it's
                 # worthwhile looking back at the log.  Since latexrun
                 # makes the earlier messages obvious, this is
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback