Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 159192 - sys-apps/man - Incomplete "whatis" database
Summary: sys-apps/man - Incomplete "whatis" database
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-27 01:07 UTC by Gautam Iyer
Modified: 2010-03-31 07:23 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gautam Iyer 2006-12-27 01:07:13 UTC
Hi,

The "whatis" database on my system is horribly incomplete. For instance

    whatis gcc

returns "Nothing appropriate".

The problem is as follows

    1. The first line of /usr/sbin/makewhatis is NOT "#!/bin/sh"

    2. The /etc/cron.weekly/makewhatis cronjob executes

	makewhatis -u

       This won't work! Looking at the source code, makewhatis -u only adds man pages that were modified in the last 24 hours. Thus running makewhatis -u on a *weekly* basis is fundamentally flawed!

I suggest that you

    1. Add "#!/bin/sh" to the top of /usr/sbin/makewhatis

    2. Move the weekly cronjob to a daily one. (I further recommend running "makewhatis -u -w" instead of just "makewhatis -u" as is currently done).

    3. Add a monthly (or weekly) cronjob to completely regenerate the whatis database, so as to remove outdated entries, and add possibly missing entries. This can be done by putting the lines

	#! /bin/sh
	exec nice /usr/sbin/makewhatis -w

       in /etc/cron.monthly/makewhatis

The man & whatis database is extremely useful. Please fix it (as suggested above),

Thanks,

GI
Comment 1 SpanKY gentoo-dev 2006-12-27 07:23:51 UTC
(1) doesnt matter at all, the kernel will properly execute the file as a shell script
Comment 2 Gautam Iyer 2006-12-27 12:49:10 UTC
(In reply to comment #1)
> (1) doesnt matter at all, the kernel will properly execute the file as a shell
> script

Actually, (1) gave me trouble on my system (probably because the shell root uses is tcsh). Before doing (1), running makewhatis gave 

    program=makewhatis: Command not found.
    dm=: Command not found.
    for: Command not found.
    do: Command not found.
    d: Undefined variable.

Problems went away after (1).

GI
Comment 3 SpanKY gentoo-dev 2007-01-05 17:34:20 UTC
#!shebang handling has been fixed and sent upstream
Comment 4 Gautam Iyer 2007-01-06 20:20:12 UTC
1. I noticed that makewhatis.cron still runs "makewhatis -u", and not "makewhatis -u -w". On my system omiting the -w causes makewhatis to not index Qt3, and some gcc man pages.

2. You still don't COMPLETELY REBUILD the whatis database frequently. If you don't you could miss a lot of man pages. For example, user installs foo, and turns off his computer BEFORE the daily cron job has run. He turns on the computer again two days later. When the daily cron job runs, it will NOT index man pages of foo.

If you want to fix the problem, you should run "makewhatis -w" every month (or every day), and "makewhatis -u -w" every day. Just running "makewhatis -u" every day is flawed, and almost pointless.

The ideal solution will be for makewhatis to store it's last run time, so that running "makewhatis -u -w" every day will generate the index correctly...

GI
Comment 5 SpanKY gentoo-dev 2007-01-07 01:35:13 UTC
that's funny, i dont recall saying i did anything other than changing the shebang in the file ... so why are you telling me things i already know ?

as for adding -w, i dont see the point ... makewhatis already has the same logic as `man --path`
Comment 6 Gautam Iyer 2007-01-07 03:00:44 UTC
(In reply to comment #5)
> that's funny, i dont recall saying i did anything other than changing the
> shebang in the file ... so why are you telling me things i already know ?

Lol. I just emerge --synced, and saw your fixes. For some reason I assumed that
your message meant you were "done with it". That of course set me panicking because its still broken on my system ...

> as for adding -w, i dont see the point ... makewhatis already has the same
> logic as `man --path`

Strangely it doesn't seem to work that way on my system. When I add a -v too,
it only looks in /usr/share/man and /usr/local/man. Adding -w makes it look in
all the other directories too ...

Thanks for fixing it :)

GI
Comment 7 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-03-31 07:23:05 UTC
Looks like this was fixed long ago, if not, please reopen.