linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Wilk <jwilk@jwilk.net>
To: Alejandro Colomar <alx.manpages@gmail.com>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>,
	"G. Branden Robinson" <g.branden.robinson@gmail.com>,
	<linux-man@vger.kernel.org>
Subject: Re: [PATCH] drop spurious t comment header
Date: Sat, 5 Nov 2022 19:26:20 +0100	[thread overview]
Message-ID: <20221105182620.wvi25miqwl2m3q72@jwilk.net> (raw)
In-Reply-To: <f18330a6-cbb1-c7cd-8e30-a79fe9203bcc@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1441 bytes --]

* Alejandro Colomar <alx.manpages@gmail.com>, 2022-08-20 01:50:
>>Lintian, the Debian package checker, sets the MANROFFSEQ environment 
>>variable to empty string as a speed optimization. This turns off 
>>loading preprocessors that weren't explicitly declared in the 
>>source. The lack of '\" comments can cause false positives (and 
>>maybe also false negatives?) in Lintian.
>>
>>The use of $MANROFFSEQ for Lintian was proposed here: 
>>https://bugs.debian.org/677874
>>
>>Beware that the man(1) man page does not correctly explain what 
>>$MANROFFSEQ does: https://bugs.debian.org/971009
>
>If we can have a test that makes sure the comment is accurate, I 
>wouldn't mind reintroducing it.  If you would like to add a lint-* 
>target that tests pages to check that they have the comment iff they 
>need it, I'll accept it.
>
>I guess that may be asking too much work.  Maybe showing how to 
>reliably test it for a page would be enough (I could transform it into 
>a Makefile test).  I can think of a small sh(1) script that could do 
>it, but is there any tool that already does it?

I'm not aware of anything like that, so I hacked up a script that runs 
man twice, with and without empty MANROFFSEQ, and compares the results. 
See the attachment.

It looks like in our case all the missing preprocessor declarations can 
be added with this:

     grep -l -x '^[.]TS$' man*/* | sort -u | xargs sed -i -e "1i'\\\\\" t"

-- 
Jakub Wilk

[-- Attachment #2: missing-preprocessors --]
[-- Type: text/plain, Size: 306 bytes --]

#!/bin/sh
set -e -u
if [ $# -eq 0 ]
then
	printf 'Usage: %s FILE [FILE...]\n' "$0" >&2
	exit 1
fi
for file
do
	m1=$(sed -e 's/^[.]so .*//' "$file" | env -u MANROFFSEQ man -l -)
	m2=$(sed -e 's/^[.]so .*//' "$file" | env MANROFFSEQ='' man -l -)
	if [ "$m1" != "$m2" ]
	then
		printf '%s\n' "$file"
	fi
done

  reply	other threads:[~2022-11-05 19:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-23 21:53 [PATCH] drop spurious t comment header Mike Frysinger
2020-07-24  0:03 ` G. Branden Robinson
2020-07-24 10:13   ` Michael Kerrisk (man-pages)
2020-07-24 12:15     ` G. Branden Robinson
2020-07-24 12:30       ` Michael Kerrisk (man-pages)
2020-07-24 13:13         ` Stefan Puiu
2020-07-24 15:17           ` Michael Kerrisk (man-pages)
2022-08-19 20:21     ` Jakub Wilk
2022-08-19 23:50       ` Alejandro Colomar
2022-11-05 18:26         ` Jakub Wilk [this message]
2022-11-06 23:33           ` Alejandro Colomar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221105182620.wvi25miqwl2m3q72@jwilk.net \
    --to=jwilk@jwilk.net \
    --cc=alx.manpages@gmail.com \
    --cc=g.branden.robinson@gmail.com \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).