Mail archive

[alpine-aports] Bugs in man and manpages

From: Isaac Dunham <>
Date: Sun, 16 Aug 2015 21:14:51 -0700

Hello all,
I've run into some issues related to manpages.

1- dangling links to manpages
 I encountered some dangling links in dosfstools-doc, which pointed to
the original, uncompressed, manpages.
Apparently there's a bug in the abuild manpage compression code (lines
1410-1413). While abuild does find and compress the actual manpages,
all the symlinks to the manpages never get updated.

2- translated manpages never get compressed.
A bug in the same code.

Roughly, a fix for these issues could look like this:

        find "$subpkgdir"/usr/share/man/man[1-9]* \
                "$subpkgdir"/usr/share/man/*/man[1-9]* \
                -type f \! -name \*.gz \! -name \*.bz2 2>/dev/null |
                xargs -r gzip -9
        find "$subpkgdir"/usr/share/man/man[1-9]* \
                "$subpkgdir"/usr/share/man/*/man[1-9]* \
                -type l \! -name \*.gz \! -name \*.bz2 2>/dev/null | {
                while read MAN; do
                        case "$MAN" in
                        ln -s `readlink "$MAN"`.gz "$MAN".gz
                        rm "$MAN"

Finally, there's an annoyance I have with mdocml.
It's impossible to specify the POSIX manpage if another manpage for the same command/function is installed in the same numeric section.
On Debian, you can have the manpages:

installed at the same time, and get the POSIX manpage via:
man 1p ls

On Alpine, this fails; the root cause seems to be that if you specify a
section, mdocml insists on looking in

If you have both the Linux and POSIX manpages installed (which I always do),
"man 3 fprintf" gives you the Linux manpage, as would be expected.
But "man 3p fprintf" says "man: No entry for fprintf in the manual."
When I run
 ln -s man3 /usr/share/man/man3p
  man 3p fprintf
I end up getting the Linux manpage, which suggests that there *is* fuzzy matching code, but the logic is backwards.

Isaac Dunham

Received on Sun Aug 16 2015 - 21:14:51 GMT