From: Alejandro Colomar <alx.manpages@gmail.com>
To: Jakub Wilk <jwilk@jwilk.net>
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: Mon, 7 Nov 2022 00:33:51 +0100 [thread overview]
Message-ID: <07a7d4e7-79a6-b2c3-6892-1e39a0679f27@gmail.com> (raw)
In-Reply-To: <20221105182620.wvi25miqwl2m3q72@jwilk.net>
[-- Attachment #1.1: Type: text/plain, Size: 2039 bytes --]
Hi Jakub!
On 11/5/22 19:26, Jakub Wilk wrote:
> * 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"
Hmm, great!
For adding it to the makefiles so it can lint future pages if they add or remove
some tables, I'll add something like:
foo: bar
! grep '^\.TS$$' $< >/dev/null || head -n1 $< | grep '\\" t$$'>/dev/null
! head -n1 $< | grep '\\" t$$' >/dev/null || grep '^\.TS$$' $<>/dev/null
I.e., if we find .TS, we better find \" t, and if we find \" t, we better find .TS.
Does it look good to you?
Thanks,
Alex
--
<http://www.alejandro-colomar.es/>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2022-11-06 23:34 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
2022-11-06 23:33 ` Alejandro Colomar [this message]
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=07a7d4e7-79a6-b2c3-6892-1e39a0679f27@gmail.com \
--to=alx.manpages@gmail.com \
--cc=g.branden.robinson@gmail.com \
--cc=jwilk@jwilk.net \
--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