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

Bug#450432: ... and even more bugs like this?



	Last week I've reported a bug in ifconfig(8) (as of net-tools
	1.60-17.)  The problem is in that the ifconfig.8 contains the
	following:

--cut--
.B ifconfig eth0:0 down
. Note: for every scope (i.e. same net with address/netmask combination) all
aliases are deleted, if you delete the first (primary).
--cut--

	This is (I guess) intended to be rendered by Groff as:
	``ifconfig ... in the bold face, then period (.), then Note:,
	...''  However, it renders just as if there were no ``. Note:
	...'' line at all.  I guess, it happens because Groff interprets
	``. Note:'' (or ``. Note''?) as a ``command'', and since it
	knows no definition for it, it ignores the entire line.

	The problem is that ifconfig.8 isn't the only file with such a
	misfeature!

$ bash check-man-periods.sh /usr/share/man/man1/*.gz
/usr/share/man/man1/gpg.1.gz:. This is only used when \fB--use-agent\fR has
/usr/share/man/man1/ocamldoc.1.gz:. The file
/usr/share/man/man1/rpost.1.gz:. If this form is used, any port number specified via the -N option
/usr/share/man/man1/sfxtest.1.gz:. Higher values of mode are more verbose.
...
/usr/share/man/man1/v.surf.rst.1grass.gz:. User can choose to output vector files \fItreefile\fR and \fIoverfile\fR
...
$ 

	(Look below for check-man-periods.sh.)

	What I'm expected to do, then?  (With respect to Debian BTS.)  I
	believe, start filing multiple bug reports would be a bad idea
	(for me now.)  May I suggest an explicit warning to be generated
	by Groff on unknown ``command'', so that lintian(1) will issue a
	warning on a malformed manual page, too?  (Or a ``strict check''
	mode for Groff, to be used especially by lintian and alike?)

	And, out of curiosity, was the ``. Note:'' (and similar) ever
	rendered by Groff, and if it is, when the behaviour was changed?

#!/bin/bash
### check-man-periods.sh --- Check man pages for ``period bugs''  -*- Sh -*-

examine_1 () {
    local f="$1"
    local s='\([[:blank:]].*\)\?$'
    ## a rough approximation...
    ## FIXME: nor commas, nor backslashes are allowed in $1
    sed -e '/^[.][[:blank:]]/!d' \
	-e '/^[.][[:blank:]]\+[.[:digit:][]/d' \
	-e '/^[.][[:blank:]]\+\(B[IR]\?\|[IP]P\|SM\|\\["}]\)'"$s"'/d' \
	-e '/^[.][[:blank:]]\+\(ad\|br\|de\|ds\|el\|fi\)'"$s"'/d'  \
	-e '/^[.][[:blank:]]\+\(ftr\?\|hy\|ie\|if\|in\|mso\|\)'"$s"'/d' \
	-e '/^[.][[:blank:]]\+\(n[efhrs]\|nop\|r[mr]\|t[im]\)'"$s"'/d' \
	-e '/^[.][[:blank:]]\+\(warn\|while\)'"$s"'/d' \
	-e "s,^,$f:,"
}

for f in "$@"; do
    case "$f" in
	(*.gz) zcat "$f" | examine_1 "$f" ;;
	(*)       < "$f"   examine_1 "$f" ;;
    esac
done

### check-man-periods.sh ends here



Reply to: