Skip to contentSkip to conversation

Makefile: provide check-groff-warnings target

PATCH In review Simon Paillard 2 participants 2 messages Aug 26, 2012 – Oct 21, 2012 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: provide check-groff-warnings target

---
 Makefile |   11 +++++++++++
 1 file changed, 11 insertions(+)
Makefile +11 -0
index f5229c5..a4713ee 100644
@@ -55,5 +55,16 @@ install:
 		install -m 644 "$$i"/* $(DESTDIR)$(MANDIR)/"$$i" || exit $$?; \
 	done; \
 
+# Check if groff reports warnings (may be words of sentances not displayed)
+# from http://lintian.debian.org/tags/manpage-has-errors-from-man.html 
+GROFF_LOG := $(shell mktemp /tmp/manpages-checksXXXX)
+check-groff-warnings:
+	for i in man?/*.*; \
+	do \
+	   LC_ALL=en_US.UTF-8 MANWIDTH=80 man --warnings -E UTF-8 -l $$i > /dev/null 2>$(GROFF_LOG); \
+	   [ -s $(GROFF_LOG) ] && ( echo "$$i: " ; cat $(GROFF_LOG) ; echo "" ); \
+	   rm $(GROFF_LOG) 2>/dev/null; \
+	done
+
 # someone might also want to look at /var/catman/cat2 or so ...
 # a problem is that the location of cat pages varies a lot
Signature · 6 lines
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
In reply to a message not in the archive

Thanks Simon. That's a useful addition. I tweaked very slightly, so that the loop ignores link files and thus runs somewhat faster.

Quoted 32 lines · Simon Paillard
---
 Makefile |   11 +++++++++++
 1 file changed, 11 insertions(+)
Makefile +11 -1
index f5229c5..a4713ee 100644
@@ -55,5 +55,16 @@ install:
                install -m 644 "$$i"/* $(DESTDIR)$(MANDIR)/"$$i" || exit $$?; \
        done; \
 
+# Check if groff reports warnings (may be words of sentances not displayed)
+# from http://lintian.debian.org/tags/manpage-has-errors-from-man.html
+GROFF_LOG := $(shell mktemp /tmp/manpages-checksXXXX)
+check-groff-warnings:
+       for i in man?/*.*; \
+       do \
+          LC_ALL=en_US.UTF-8 MANWIDTH=80 man --warnings -E UTF-8 -l $$i > /dev/null 2>$(GROFF_LOG); \
+          [ -s $(GROFF_LOG) ] && ( echo "$$i: " ; cat $(GROFF_LOG) ; echo "" ); \
+          rm $(GROFF_LOG) 2>/dev/null; \
+       done
+
 # someone might also want to look at /var/catman/cat2 or so ...
 # a problem is that the location of cat pages varies a lot
--

1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 7 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Author of "The Linux Programming Interface"; http://man7.org/tlpi/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html