drop spurious t comment header
PATCH 1/1 drop spurious t comment header
From: Mike Frysinger <[email protected]>
A bunch of pages have this random comment at the start of its header, but most do not. Just trim it everywhere.
--- man2/fcntl.2 | 1 - man2/lseek.2 | 1 - man2/mq_getsetattr.2 | 1 - man2/sgetmask.2 | 1 - man2/sigaction.2 | 1 - man2/sigaltstack.2 | 1 - man2/socket.2 | 1 - man2/stat.2 | 1 - man2/statx.2 | 1 - man2/syslog.2 | 1 - man3/aio_init.3 | 1 - man3/dladdr.3 | 1 - man3/dlinfo.3 | 1 - man3/duplocale.3 | 1 - man3/inet_net_pton.3 | 1 - man3/isfdtype.3 | 1 - man3/mallinfo.3 | 1 - man3/malloc_stats.3 | 1 - man3/malloc_trim.3 | 1 - man3/mallopt.3 | 1 - man3/matherr.3 | 1 - man3/mq_close.3 | 1 - man3/mq_getattr.3 | 1 - man3/mq_notify.3 | 1 - man3/mq_open.3 | 1 - man3/mq_receive.3 | 1 - man3/mq_send.3 | 1 - man3/mq_unlink.3 | 1 - man3/pthread_atfork.3 | 1 - man3/sem_close.3 | 1 - man3/sem_destroy.3 | 1 - man3/sem_getvalue.3 | 1 - man3/sem_init.3 | 1 - man3/sem_open.3 | 1 - man3/sem_post.3 | 1 - man3/sem_unlink.3 | 1 - man3/sem_wait.3 | 1 - man3/sigset.3 | 1 - man3/sigvec.3 | 1 - man3/uselocale.3 | 1 - man4/console_codes.4 | 1 - man4/dsp56k.4 | 1 - man4/fd.4 | 1 - man4/lp.4 | 1 - man4/mouse.4 | 1 - man7/aio.7 | 1 - man7/arp.7 | 1 - man7/ascii.7 | 1 - man7/inode.7 | 1 - man7/inotify.7 | 1 - man7/ip.7 | 1 - man7/mq_overview.7 | 1 - man7/netdevice.7 | 1 - man7/netlink.7 | 1 - man7/pthreads.7 | 1 - man7/raw.7 | 1 - man7/rtnetlink.7 | 1 - man7/sem_overview.7 | 1 - man7/shm_overview.7 | 1 - man7/signal.7 | 1 - man7/socket.7 | 1 - man7/units.7 | 1 - 62 files changed, 62 deletions(-)
man2/fcntl.2 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" This manpage is Copyright (C) 1992 Drew Eckhardt; .\" and Copyright (C) 1993 Michael Haardt, Ian Jackson; .\" and Copyright (C) 1998 Jamie Lokier;
man2/lseek.2 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (c) 1980, 1991 Regents of the University of California. .\" and Copyright (c) 2011, Michael Kerrisk <[email protected]> .\" All rights reserved.
man2/mq_getsetattr.2 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (C) 2006 Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man2/sgetmask.2 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (c) 2007 by Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man2/sigaction.2 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (c) 1994,1995 Mike Battersby <[email protected]> .\" and Copyright 2004, 2005 Michael Kerrisk <[email protected]> .\" based on work by [email protected]
man2/sigaltstack.2 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (c) 2001, 2017 Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man2/socket.2 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (c) 1983, 1991 The Regents of the University of California. .\" All rights reserved. .\"
man2/stat.2 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (c) 1992 Drew Eckhardt ([email protected]), March 28, 1992 .\" Parts Copyright (c) 1995 Nicolai Langfeldt ([email protected]), 1/1/95 .\" and Copyright (c) 2006, 2007, 2014 Michael Kerrisk <[email protected]>
man2/statx.2 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (c) 2017 David Howells <[email protected]> .\" .\" Derived from the stat.2 manual page:
man2/syslog.2 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (C) 1995 Andries Brouwer ([email protected]) .\" and Copyright (C) 2012, 2014 Michael Kerrisk <[email protected]> .\"
man3/aio_init.3 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (c) 2010 by Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man3/dladdr.3 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (C) 2015 Michael Kerrisk <[email protected]> .\" and Copyright (C) 2008 Petr Baudis <[email protected]> (dladdr caveat) .\"
man3/dlinfo.3 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (C) 2015 Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man3/duplocale.3 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (C) 2014 Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man3/inet_net_pton.3 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (C) 2014 Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man3/isfdtype.3 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (C) 2014 Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man3/mallinfo.3 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (c) 2012 by Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man3/malloc_stats.3 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (c) 2012 by Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man3/malloc_trim.3 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (c) 2012 by Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man3/mallopt.3 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (c) 2012 by Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man3/matherr.3 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (c) 2008, Linux Foundation, written by Michael Kerrisk .\" <[email protected]> .\"
man3/mq_close.3 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (C) 2006 Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man3/mq_getattr.3 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (C) 2006 Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man3/mq_notify.3 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (C) 2006 Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man3/mq_open.3 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (C) 2006 Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man3/mq_receive.3 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (C) 2006 Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man3/mq_send.3 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (C) 2006 Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man3/mq_unlink.3 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (C) 2006 Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man3/pthread_atfork.3 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (C) 2017 Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man3/sem_close.3 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (C) 2006 Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man3/sem_destroy.3 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (C) 2006 Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man3/sem_getvalue.3 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (C) 2006 Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man3/sem_init.3 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (C) 2006 Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man3/sem_open.3 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (C) 2006 Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man3/sem_post.3 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (C) 2006 Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man3/sem_unlink.3 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (C) 2006 Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man3/sem_wait.3 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (C) 2006 Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man3/sigset.3 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (c) 2005 by Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man3/sigvec.3 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (c) 2005 by Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man3/uselocale.3 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (C) 2014 Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man4/console_codes.4 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (c) 1996 Andries Brouwer <[email protected]>, Mon Oct 31 22:13:04 1996 .\" .\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA)
man4/dsp56k.4 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (c) 2000 lars brinkhoff <[email protected]> .\" .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
man4/fd.4 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (c) 1993 Michael Haardt ([email protected]) .\" and 1994,1995 Alain Knaff ([email protected]) .\"
man4/lp.4 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (c) Michael Haardt ([email protected]), .\" Sun Jan 15 19:16:33 1995 .\"
man4/mouse.4 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" This manpage is Copyright (C) 1996 Michael Haardt. .\" Updates Nov 1998, Andries Brouwer .\"
man7/aio.7 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (c) 2010 by Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man7/arp.7 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" This man page is Copyright (C) 1999 Matthew Wilcox <[email protected]>. .\" %%%LICENSE_START(VERBATIM_ONE_PARA) .\" Permission is granted to distribute possibly modified copies
man7/ascii.7 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (c) 1993 Michael Haardt ([email protected]) .\" .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
man7/inode.7 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (c) 2017 Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man7/inotify.7 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (C) 2006, 2014 Michael Kerrisk <[email protected]> .\" Copyright (C) 2014 Heinrich Schuchardt <[email protected]> .\"
man7/ip.7 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" This man page is Copyright (C) 1999 Andi Kleen <[email protected]>. .\" .\" %%%LICENSE_START(VERBATIM_ONE_PARA)
man7/mq_overview.7 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (C) 2006 Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man7/netdevice.7 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" This man page is Copyright (C) 1999 Andi Kleen <[email protected]>. .\" .\" %%%LICENSE_START(VERBATIM_ONE_PARA)
man7/netlink.7 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" This man page is Copyright (c) 1998 by Andi Kleen. .\" .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
man7/pthreads.7 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (c) 2005 by Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man7/raw.7 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" This man page is Copyright (C) 1999 Andi Kleen <[email protected]>. .\" .\" %%%LICENSE_START(VERBATIM_ONE_PARA)
man7/rtnetlink.7 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" This man page is Copyright (C) 1999 Andi Kleen <[email protected]>. .\" .\" %%%LICENSE_START(VERBATIM_ONE_PARA)
man7/sem_overview.7 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (C) 2006 Michael Kerrisk <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
man7/shm_overview.7 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (C) 2008, Linux Foundation, written by Michael Kerrisk .\" <[email protected]> .\"
man7/signal.7 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (c) 1993 by Thomas Koenig ([email protected]) .\" and Copyright (c) 2002, 2006 by Michael Kerrisk <[email protected]> .\" and Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk
man7/socket.7 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" This man page is Copyright (C) 1999 Andi Kleen <[email protected]>. .\" and copyright (c) 1999 Matthew Wilcox. .\"
man7/units.7 +0 -1
@@ -1,4 +1,3 @@ -'\" t .\" Copyright (C) 2001 Andries Brouwer <[email protected]> .\" .\" %%%LICENSE_START(VERBATIM)
Signature · 1 line
2.26.2
Quoted 4 lines · Mike Frysinger
From: Mike Frysinger <[email protected]>
A bunch of pages have this random comment at the start of its header, but most do not. Just trim it everywhere.
It's pretty misleading to call it "random"; it is a hint to the man program to preprocess the man page text through tbl.
This is documented in subsection "Interaction with preprocessors" of groff_man(5).
The patch itself might be fine; the first couple of pages it alters indeed use no tables, according to the check I ran:
grep -l '^\.\s*TS' man[1-8]/*
...but the comment is certainly not meaningless noise, which is what "random" suggests, and I would not characterize the change this in a commit message.
Regards,
Branden
Hi Branden, Mike,
Quoted 8 lines · G. Branden Robinson
Quoted 4 lines · Mike Frysinger
From: Mike Frysinger <[email protected]>
A bunch of pages have this random comment at the start of its header, but most do not. Just trim it everywhere.
It's pretty misleading to call it "random";
(True.)
Quoted 2 lines
it is a hint to the man
program to preprocess the man page text through tbl.
Yes, that's my understanding. But I believe that these days it's no longer needed(?). tbl(1) just gets used as needed, regardless of the presence of the 't' comment, right?
Quoted 10 lines
This is documented in subsection "Interaction with preprocessors" of
groff_man(5).The patch itself might be fine; the first couple of pages it alters indeed use no tables, according to the check I ran:
grep -l '^\.\s*TS' man[1-8]/*...but the comment is certainly not meaningless noise, which is what "random" suggests, and I would not characterize the change this in a commit message.
See my comments above. For 15 years or at least, I've not paid any attention to adding the 't' comments when I added tables to pages, and I do recall anyone reporting ill effects. So, I'm inclined to apply Mike's patch, but will hold off a moment, in case there's other feedback.
Cheers,
Michael
Signature · 3 lines
Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/
Quoted 8 lines · Michael Kerrisk (man-pages)
Quoted 2 lines · G. Branden Robinson
it is a hint to the man
program to preprocess the man page text through tbl.Yes, that's my understanding. But I believe that these days it's no longer needed(?). tbl(1) just gets used as needed, regardless of the presence of the 't' comment, right?
[A few "strace -f -e execve"s later...]
Hmm, for the man-db man(1) in Debian bullseye (testing), at least, this is true! And checking its own man page, it looks like it was true as far back as April 2001 (the horizon of its Git history).
I guess there are so many man pages that embed tables without including the hint that the man-db maintainers decided not to leave the comment to chance. The only other man-like program I know if in anything like wide use on Linux systems is mandoc, which does all its own parsing and doesn't depend on a *roff at all.
Retaining an accurate comment would be a kindness to other man implementations I'm not aware of and to weirdos like me who run groff directly because we develop it (though admittedly, even for us, there is the crutch of grog(1)). But I'll grant--these populations may be small.
Quoted 5 lines
See my comments above. For 15 years or at least, I've not paid any attention to adding the 't' comments when I added tables to pages, and I do recall anyone reporting ill effects. So, I'm inclined to apply Mike's patch, but will hold off a moment, in case there's other feedback.
Sounds fair.
Regards,
Branden
Hi Branden, Mike,
Quoted 12 lines · G. Branden Robinson
Quoted 8 lines · Michael Kerrisk (man-pages)
Quoted 2 lines · G. Branden Robinson
it is a hint to the man
program to preprocess the man page text through tbl.Yes, that's my understanding. But I believe that these days it's no longer needed(?). tbl(1) just gets used as needed, regardless of the presence of the 't' comment, right?
[A few "strace -f -e execve"s later...]
Quoted 7 lines
Hmm, for the man-db man(1) in Debian bullseye (testing), at least, this is true! And checking its own man page, it looks like it was true as far back as April 2001 (the horizon of its Git history).
I guess there are so many man pages that embed tables without including the hint that the man-db maintainers decided not to leave the comment to chance.
That would be my guess.
Quoted 8 lines
The only other man-like program I know if in anything like wide use on Linux systems is mandoc, which does all its own parsing and doesn't depend on a *roff at all.
Retaining an accurate comment would be a kindness to other man implementations I'm not aware of and to weirdos like me who run groff directly because we develop it (though admittedly, even for us, there is the crutch of grog(1)). But I'll grant--these populations may be small.
Yes, and in any case, the man-pages pages are already widely omitting this comment.
Quoted 7 lines
Quoted 5 lines
See my comments above. For 15 years or at least, I've not paid any attention to adding the 't' comments when I added tables to pages, and I do recall anyone reporting ill effects. So, I'm inclined to apply Mike's patch, but will hold off a moment, in case there's other feedback.
Sounds fair.
Branden, thanks for your detailed analysis.
Mike, I've applied the patch, but completely rewrote the commit message, as below.
Cheers,
Michael
==
Various pages: Drop t comment header
Historically, a comment of the following form at the top of a manual page was used to indicate too man(1) that the use of tbl(1) was required in order to process tables:
'\" t
However, at least as far back as 2001 (according to Branden), man-db's man(1) automatically uses tbl(1) as needed, rendering this comment unnecessary. And indeed many existing pages in man-pages that have tables don't have this comment at the top of the file. So, drop the comment from those files where it is present.
Signature · 3 lines
Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/
Hi Michael,
I think I noticed one typo in your description text (and I also see it in git):
Quoted 2 lines · Michael Kerrisk (man-pages)
Historically, a comment of the following form at the top of a manual page was used to indicate too man(1) that the use of tbl(1)
s/too man/to man?
Quoted 8 lines
was required in order to process tables:
'\" t--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
Hi Stefan,
Quoted 11 lines · Stefan Puiu
Hi Michael,
I think I noticed one typo in your description text (and I also see it in git):
Quoted 2 lines · Michael Kerrisk (man-pages)
Historically, a comment of the following form at the top of a manual page was used to indicate too man(1) that the use of tbl(1)
s/too man/to man?
Yes, I spotted it too, but too late...
Thanks,
Michael
Signature · 3 lines
Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/
* Michael Kerrisk <[email protected]>, 2020-07-24 12:13:
Quoted 1 line
For 15 years or at least, I've not paid any attention to adding the 't' comments when I added tables to pages, and I do recall anyone reporting ill effects. So, I'm inclined to apply Mike's patch, but will hold off a moment, in case there's other feedback.
I'm a bit late, but...
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
Signature · 1 line
Jakub Wilk
Hi Jakub,
Quoted 10 lines · Jakub Wilk
* Michael Kerrisk <[email protected]>, 2020-07-24 12:13:
Quoted 1 line
For 15 years or at least, I've not paid any attention to adding the 't' comments when I added tables to pages, and I do recall anyone reporting ill effects. So, I'm inclined to apply Mike's patch, but will hold off a moment, in case there's other feedback.
I'm a bit late, but...
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?
Cheers,
Alex
Signature · 2 lines
Alejandro Colomar <http://www.alejandro-colomar.es/>
* Alejandro Colomar <[email protected]>, 2022-08-20 01:50:
Quoted 9 lines
Quoted 5 lines
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
Makefiletest). 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"
Signature · 1 line
Jakub Wilk
#!/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
Hi Jakub!
Quoted 9 lines · Jakub Wilk
* Alejandro Colomar <[email protected]>, 2022-08-20 01:50:
Quoted 8 lines
Quoted 5 lines
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.
Quoted 7 lines
Quoted 1 line
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
Makefiletest). 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
Signature · 1 line
<http://www.alejandro-colomar.es/>