Re: [PATCH] drop spurious t comment header

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

 



Hi Jakub!

On 11/5/22 19:26, Jakub Wilk wrote:
* Alejandro Colomar <alx.manpages@xxxxxxxxx>, 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: OpenPGP_signature
Description: OpenPGP digital signature


[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux