Bug#377392: Bug#450432: ... and even more bugs like this?
In a recent thread in debian-devel, it was suggested that
lintian could call man(1) in such a way that the groff(1),
called by `man', will emit warnings for every undefined macro,
which is useful in catching the bugs like this:
.B foo
. Note: ...
Below is the patch that implements the suggestion. Since `man'
doesn't allow the `-wmac' option to be passed to `groff' by any
other means, I've had to introduce two new files -- `mdoc.local'
and `man.local' (to override the files in groff/site-tmac/), and
the ${LINTIAN_ROOT}/groff-hack directory to hold them.
--- lintian-1.23.36/checks/manpages 2007-10-16 10:40:04.000000000 +0700
+++ lintian-1.23.36-groff-hack/checks/manpages 2007-11-16 00:16:11.000000000 +0600
@@ -253,10 +253,12 @@
# processed properly. (Yes, there are man pages that include other
# pages with .so but aren't simple links; rbash, for instance.)
my $cmd;
+ my $groff_dir = "$ENV{'LINTIAN_ROOT'}/groff-hack/";
+ my $man_cmd = "GROFF_TMAC_PATH='$groff_dir' man -l";
if ($file =~ m,^(.*)/(man\d/.*)$,) {
- $cmd = "cd unpacked/\Q$1\E && man -l \Q$2\E";
+ $cmd = ("cd unpacked/\Q$1\E && $man_cmd \Q$2\E");
} else {
- $cmd = "man -l unpacked/\Q$file\E";
+ $cmd = "$man_cmd unpacked/\Q$file\E";
}
my $pid = open MANERRS, '-|';
if (not defined $pid) {
diff -drHuN --exclude='*~' lintian-1.23.36/debian/rules lintian-1.23.36-groff-hack/debian/rules
--- lintian-1.23.36/debian/rules 2006-11-19 07:11:32.000000000 +0600
+++ lintian-1.23.36-groff-hack/debian/rules 2007-11-16 00:11:37.000000000 +0600
@@ -45,7 +45,7 @@
install -m 755 frontend/lintian-info $(tmp)/usr/bin/
# library files
@echo .... install library files ....
- for d in checks collection lib unpack; do \
+ for d in checks collection lib unpack groff-hacks; do \
install -d $(usl)/$$d; \
find $$d -type f ! -path '*/CVS/*' ! -path '*/.svn/*' \
| xargs -iFILE cp -p FILE $(usl)/$$d/; \
diff -drHuN --exclude='*~' lintian-1.23.36/groff-hacks/man.local lintian-1.23.36-groff-hack/groff-hacks/man.local
--- lintian-1.23.36/groff-hacks/man.local 1970-01-01 07:00:00.000000000 +0700
+++ lintian-1.23.36-groff-hack/groff-hacks/man.local 2007-11-14 23:09:47.000000000 +0600
@@ -0,0 +1,2 @@
+.warn 512
+.mso /usr/share/groff/site-tmac/man.local
diff -drHuN --exclude='*~' lintian-1.23.36/groff-hacks/mdoc.local lintian-1.23.36-groff-hack/groff-hacks/mdoc.local
--- lintian-1.23.36/groff-hacks/mdoc.local 1970-01-01 07:00:00.000000000 +0700
+++ lintian-1.23.36-groff-hack/groff-hacks/mdoc.local 2007-11-14 23:09:48.000000000 +0600
@@ -0,0 +1,2 @@
+.warn 512
+.mso /usr/share/groff/site-tmac/mdoc.local
Reply to: