From Bugzilla Helper: User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.4.2 i686) Apropos and whatis were both changed to look in /var/cache/man for whatis databases. Unfortunately, the "$manpath" part of the original command was deleted during the change. /usr/lib/whatis is obsolete, but it is still searched. Reproducible: Always Steps to Reproduce: 1.man -k rpm 2.apropos rpm 3.whatis rpm Actual Results: rpm: nothing appropriate Expected Results: mookie:~# apropos rpm Rpmfind [rpmfind] (1) - find rpms on the internet autorpm (8) - RPM FTP Mirror and/or Auto-Update utility autorpm.conf [autorpm] (5) - Config file for AutoRPM rpm (8) - Red Hat Package Manager rpm2cpio (8) - Extract cpio archive from RPM Package Manager (RPM) package mookie:~# whatis rpm rpm (8) - Red Hat Package Manager Change these two lines in /usr/bin/apropos and /usr/bin/whatis: 71c71 < for d in /var/cache/man /usr/lib --- > for d in /var/cache/man $manpath /usr/lib 105c105 < for d in /var/cache/man /usr/lib --- > for d in /var/cache/man $manpath /usr/lib
The /usr/sbin/makewhatis script was also broken in this release. The value /var/cache/man was substituted everywhere a manual path element had been used previously, even in loops. For example the /var/cache/man/whatis file is clobbered once for each directory in the manpath. The result of these misbegotten changes is that the whatis files in the manpath are not updated, and the whatis file in /var/cache/man only contains information from manual pages that have "cat" versions living under /var/cache/man. Manual pages that have not been read before on the system will never show up in whatis. What good is that?
Part #1 is fixed in 1.5i-1 to support legacy systems. Part #2 was never a problem, because /var/cache/man/whatis contains info about non-preformatted man pages. We aren't supposed to write anything to /usr (can be mounted read-only), so we're redirecting the whatis database for anything to /var/cache/man.
I noticed that the whatis database did include the unformatted pages after one of the cron jobs had run, however when I ran the usual (documented only in the makewhatis script) the manual pages for the package that I had just installed did not show up. Could you please check that the makewhatis script can properly deal with freshly installed man pages, even though the dates on the man page sources reflect the time the package was created and not when they were installed? Thank you. -- ddj
I think I've fixed the problem with makewhatis not including all pages in the database. It seems that makewhatis was skipping all "man" directories after the first one. I believe the logic should skip all "cat" directories instead. I made the following fix (/usr/sbin/makewhatis, line 150): OLD: if ... $pages = man ... NEW: if ... $pages = cat ... and it seems to have fixed the problem. Of course, I could have created other problems.
The problem in the original bug report -- that the apropos and whatis commands do not look for whatis databases in $manpath -- still exists, at least in Red Hat 7.3, and apparently 8.0 as well. These commands make two grep passes over the whatis files -- one to see if the string is found, and another to display the match -- but now only include $manpath whatis files in the second pass. So they will fail to find anything in a $manpath whatis, unless the thing you're looking for happens to be in /var/cache/man/whatis or /usr/lib/whatis. This problem is noticeable in our environment, as our users mount various network filesystems containing whatis files only on an as-needed basis; thus we cannot address this via makewhatis. The following patch to whatis is needed to get the correct behavior (apropos needs the same change): --- /usr/bin/whatis Mon Mar 25 09:17:18 2002 +++ ./whatis Thu Nov 14 15:13:22 2002 @@ -70,7 +70,7 @@ found=0 while [ $found = 0 -a -n "$1" ] do - for d in /var/cache/man /usr/lib + for d in /var/cache/man $manpath /usr/lib do if [ -f $d/whatis ] then
Looks fixed in man-1.5k-12.