Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 331979 - sys-apps/man-1.6f-r4 makewhatis determines package names incorrectly
Summary: sys-apps/man-1.6f-r4 makewhatis determines package names incorrectly
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-10 05:07 UTC by William Throwe
Modified: 2010-09-19 23:51 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
patch to fix filename detection (man-1.6f-filename.patch,1.08 KB, patch)
2010-08-10 05:10 UTC, William Throwe
Details | Diff
man-1.6f-makewhatis-compression-cleanup.patch (man-1.6f-makewhatis-compression-cleanup.patch,2.33 KB, patch)
2010-09-19 23:08 UTC, SpanKY
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description William Throwe 2010-08-10 05:07:33 UTC
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"
Comment 1 William Throwe 2010-08-10 05:10:54 UTC
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.
Comment 2 SpanKY gentoo-dev 2010-09-18 11:40:30 UTC
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
Comment 3 William Throwe 2010-09-18 16:06:48 UTC
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.
Comment 4 SpanKY gentoo-dev 2010-09-19 23:08:40 UTC
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.
Comment 5 William Throwe 2010-09-19 23:43:14 UTC
(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.
Comment 6 SpanKY gentoo-dev 2010-09-19 23:51:47 UTC
ok, ive added that to man-1.6f-r5.  thanks for testing.