A bug in the makewhatis script causes package names to be miscalculated for some compression types. Fixing bug 302380 made it stop working for bzip, causing most pages to be readded to the database with empty square brackets after the name. For example: $ whatis whatis whatis (1) - search the whatis database for complete words whatis [] (1) - search the whatis database for complete words Rebuilding the database from scratch would remove the first of these, leaving only the malformed entry. Reproducible: Always $ emerge -pqv sys-apps/man [ebuild R ] sys-apps/man-1.6f-r4 USE="-lzma -nls"
Created attachment 242199 [details, diff] patch to fix filename detection Adding this patch at the end of the epatch commands in the ebuild, recompiling, and then running makewhatis should fix the problem.
i really dont think the change with Bug 302380 caused this issue. more likely fixing that bug made you notice a bug that has always been there. what exactly is the fix ? making sure that we re-initialize the use_* variables every time to 0 ? + use_zcat = use_bzcat = use_lzcat = use_xzcat = 0; the rest (re-indentation and scoping) doesnt really seem necessary
I agree that that the bug was always there and fixing bug 302380 just made it more obvious. In terms of the patch, initializing the variables is actually unimportant. The scoping changes are really the fix. The problem is that a failed match() resets the RSTART variable used to extract filename_no_gz (visible in the trailing context of the patch), so it is important that no more match() commands are attempted after the successful one. Without the scoping, if (for example) the test for .bz2 succeeds, it prevents testing for .lzma, but doesn't prevent testing for .xz. The failing .xz test causes RSTART to be set to zero so filename_no_gz becomes the empty string.
Created attachment 248052 [details, diff] man-1.6f-makewhatis-compression-cleanup.patch ok, the awk file is run fresh every time, so the use_* vars get initialized to 0 implicitly for us. i did a little more clean up here, so make sure i didnt screw anything up.
(In reply to comment #4) > Created an attachment (id=248052) [details] > man-1.6f-makewhatis-compression-cleanup.patch > > ok, the awk file is run fresh every time, so the use_* vars get initialized to > 0 implicitly for us. i did a little more clean up here, so make sure i didnt > screw anything up. > Looks good to me.
ok, ive added that to man-1.6f-r5. thanks for testing.