summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorSimon Paillard <spaillard@debian.org>2012-10-21 09:25:20 +0200
committerMichael Kerrisk <mtk.manpages@gmail.com>2012-10-24 14:53:48 +0200
commit251da60bbbed1169dd0efc45ca5cecb8be319975 (patch)
tree2369c824625ebc1175385dec51c8a7f26178cd01 /Makefile
parent075963263e03f64e18e4073be1c42516cb4d0790 (diff)
Makefile: Add 'check-groff-warnings' target
Add a 'check-groff-warnings' target to check if groff reports warnings (the underlying problem may be causing words or sentences not to be displayed) from http://lintian.debian.org/tags/manpage-has-errors-from-man.html Some edits by mtk. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 13 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index f5229c5c..2f9ba8f0 100644
--- a/Makefile
+++ b/Makefile
@@ -55,5 +55,18 @@ 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?/*.[1-9]; \
+ do \
+ if grep -q 'SH.*NAME' $$i; then \
+ 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; \
+ fi \
+ 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