jeaye / stdman

Formatted C++20 stdlib man pages (cppreference)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Suggestion to avoid need for MANPATH or installation in /usr/local

drvink opened this issue · comments

I thought I'd make an issue here out of the comment I left on the Arch AUR package for stdman, since making this change would be an improvement on all systems, not only Arch. (The issue there was that installing the manpages to the standard location conflicted with manpages provided by gcc, and my comment--this issue--provides a solution that would be useful to package maintainers as well as normal users.)


I updated the package to install the man pages to /usr/local. They do not really belong there, but at least this restores gcc compatibility.

While it's good that you're ensuring this package doesn't conflict with the gcc package, it is explicitly forbidden to install Arch packages under /usr/local1. In fact, you really want to install these manpages in the usual location so that users don't have to modify their MANPATH or change /etc/man_db.conf in order for man to be able to find them. Resolving the conflict is easy: append a suffix (perhaps cppref) to the section part of each manpage's filename. This is done all the time in order to deal with similar manpage conflicts:

arch-vm[1060]:~% pacman -Qo /usr/share/man/man1/passwd*
/usr/share/man/man1/passwd.1.gz is owned by shadow 4.6-1
/usr/share/man/man1/passwd.1ssl.gz is owned by openssl 1.1.0.i-1

Here's all the manpage (sub)sections currently on my system:

arch-vm[1061]:~% sed -rnz 's~^.*\.([[:print:]]+)\.gz$~\1~p' <(find /usr/share/man/man* -type f -print0) | sort -z | uniq -z | xargs -0 echo
0p 1 1m 1p 1perl 1ssl 2 3 3am 3cvc 3p 3pcap 3perl 3pm 3ssl 3t 3tiff 3x 4 5 5ssl 6 7 7ssl 8 n

Users can set MANSECT in their environment or change the SECTION directive in /etc/man_db.conf if they want to change which sections are searched and in what order.

Footnotes

  1. Even if this weren't the case, and even though the Arch FAQ says that Arch follows the specifications outlined in systemd's file-hierarchy(7) manpage rather than those of the FHS, the aforementioned manpage has no mention of /usr/local at all, so deferring to the longstanding convention (also explicitly codified by the FHS) that it exists for administrators to install stuff that they don't want the system package manager to touch would still be the best course of action.