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

Bug#506271: lintian: weirdness when checking manpages with nroff ignore commands



Hi,

Thanks for your report and for indirectly forcing me to learn a little
more about *roff while investigating it.

On Thu, 2008-11-20 at 03:03 +0100, Morten Kjeldgaard wrote:
> I was not able to get rid of lintian warnings in some man pages that made
> extensive use of the nroff ignore (.ig) command. I tracked down the problem
> to a weird behaviour of man.

It's not so much weird as possibly unintuitive.The warning is also
easily fixed, as described later in this mail.

In either case, I don't believe it constitutes a bug in either lintian
or man-db.

> It seems lintian uses the command "man -l --warnings" to check the sanity
> of a manpage.

Correct.

> I did some experiments Using the following test manpage tst.1:
[...]
> ..nr Pb 0
> ..if \n(Pb .ig ZZ
> I see this!
> ..ZZ
[...]
> $ man -l --warnings  tst.1 > /dev/null
> <standard input>:10: warning: `ZZ' not defined
> 
> it is seen that man complains about the last .ZZ, which is perfectly
> legal.

Legal, yes. Defined, no. (and for what it's worth, it's actually the
_first_ use of ".ZZ" which is being flagged.)

> However, running this:
> 
> $ man -l --warnings=all  tst.1 > /dev/null
> 
> gives no output. The same is true for:
> 
> $ nroff -man -wall tst.1 > /dev/null
> 
> I don't understand what's going on here, but it seems that the
> --warnings option alone on man triggers a buggy behaviour.

There isn't a bug, merely a misunderstanding. The reason for the
difference is that "all" doesn't mean what one would (and I did) naively
expect it to mean. From troff(1):

/===============
| There are also names that can be used to refer to groups of warnings:
|
|       all    All warnings except di, mac, and reg.  It is intended
|		that this covers all  warnings  that  are useful with
|		traditional macro packages.
|
|       w      All warnings.
\===============

man(1) indicates that "man --warnings" is a shorthand for "man
--warnings=mac", which is why the warning disappears when you use the
"all" warning set.

For the record, the issue is easily fixable in the manpage by simply
defining ZZ before attempting to use it; inserting the following
anywhere before the first use of .ig would suffice:

.de ZZ
..

> I suggest that the checking string in lintian is changed so
> it uses nroff directly, since that is what is invoked by man anyway.

I disagree. lintian is checking a manpage; the fact that doing so
invokes nroff is an implementation detail.

Regards,

Adam



Reply to: