Hi Ingo,

On 8/2/22 16:17, Ingo Schwarze wrote:
Strictly speaking, the third argument of the man(7) .TH macro is supposed
to be the date when a human being last edited the content of the manual
page, or in case rst2man(1) is used, the date when a human being last
edited the content of the input '*.rst' file, *not* the date when
rst2man(1) did the format conversion.

I use it to update bpf-helpers(7), from kernel stuff. See <https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/commit/man7/bpf-helpers.7?id=19c7f78393f2b038e76099f87335ddf43a87f039>

I pick a file from the linux git repo, so the fs timestamp is going to be meaningless. It would make sense to add an optional argument to the `--date` option, so that one would be able to pass a more meaningful date:

/path/to/linux//scripts/bpf_doc.py | rst2man --date="..." > man7/bpf-helpers.7


That said, i am able to reproduce that the rst2man(1) program contained
in the py3-docutils-0.17.1 package on OpenBSD-current also puts the line
"Generated on: 2022\-08\-02." into the NAME section, which is indeed a
severe man(7) syntax error.  So the bug appears to be operating system
independent.

If the date of the last human edit is unknown, putting the date on
which rst2man(1) was run into the third argument of the .TH macro
is of course still better than putting it into a place where it
violates the syntax of the man(7) language.  On the other hand,
couldn't the correct time be found by inspecting the mtime of
the inode of the '*.rst' file?


The input might very well be stdin. What to do in that case? I guess current date would be the best thing to do.

Cheers,

Alex

--
Alejandro Colomar
<http://www.alejandro-colomar.es/>

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to