The /usr/share/man/man1/awk.1.bz2 symlink is managed by sys-apps/gawk instead of app-alternatives/awk. Since /usr/bin/man prefers the compressed man page, the (correctly managed) /usr/share/man/awk.1 file is ignored when the awk man page is displayed when anything else but gawk is selected by USE flag when emerging app-alternatives/awk. Conditions to cause the bug to manifest: 1. Start with an "out of box" Gentoo install, which prefers gawk. 2. Install an alternative awk, for example: USE="-gawk nawk" emerge -1v awk Now /usr/share/man/man1/awk.1 will correctly render the nawk man page, but /usr/share/man/man1/awk.1.bz2 is still symlinked to the gawk man page, so running man awk will get you the gawk man page instead of the nawk one.
Please include emerge --info for completeness.
Created attachment 857085 [details] emerge --info as requested.
That's weird because app-alternatives/awk definitely has stale symlink cleanup code.
In my read-through of the awk ebuild and the app-alternatives eclass, I didn't immediately find any code that looked like it was managing the _compressed_ man page symlink that the gawk ebuild leaves behind: ceres ~ # ls -lrt /usr/share/man/man1/awk* lrwxrwxrwx 1 root root 10 Mar 10 07:40 /usr/share/man/man1/awk.1.bz2 -> gawk.1.bz2 -rw-r--r-- 1 root root 11 Mar 10 07:44 /usr/share/man/man1/awk.1
(In reply to John R. Graham from comment #4) > In my read-through of the awk ebuild and the app-alternatives eclass, I > didn't immediately find any code that looked like it was managing the > _compressed_ man page symlink that the gawk ebuild leaves behind: > > ceres ~ # ls -lrt /usr/share/man/man1/awk* > lrwxrwxrwx 1 root root 10 Mar 10 07:40 /usr/share/man/man1/awk.1.bz2 -> > gawk.1.bz2 > -rw-r--r-- 1 root root 11 Mar 10 07:44 /usr/share/man/man1/awk.1 https://gitweb.gentoo.org/repo/gentoo.git/tree/app-alternatives/awk/awk-4.ebuild#n65 should catch it? (It was added for bug 884427).
Ah. Yes. That version wasn't in tree when I did my read-through. Still, an emerge of sys-apps/gawk will re-establish the symlink and does not currently force the rebuild of app-alternatives/awk (which would now remove it). I guess that means that the gawk ebuild needs a tweak as well.
I suppose we could just drop pkg_preinst and pkg_postinst from sys-apps/gawk now hat app-alternatives/awk is stable.
Err, I mean pkg_postist and pkg_postrm.