Bug 454880 - makewhatis does not index all man pages.
makewhatis does not index all man pages.
Status: CLOSED WORKSFORME
Product: Fedora
Classification: Fedora
Component: man (Show other bugs)
9
All Linux
low Severity medium
: ---
: ---
Assigned To: Ivana Varekova
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-07-10 10:48 EDT by Andrew Piziali
Modified: 2008-07-23 03:02 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-07-23 03:02:48 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
/var/cache/man/whatis (934.76 KB, text/plain)
2008-07-22 19:44 EDT, Andrew Piziali
no flags Details

  None (edit)
Description Andrew Piziali 2008-07-10 10:48:38 EDT
Description of problem:

   The program "apropos" (and its equivalent "man -k") fails to find
   many man pages that include the search term in their "NAME" line
   because makewhatis does not index pages that define the NAME section
   header without quoting NAME:

	.SH NAME

   Only those man pages that quote NAME as in:

	.SH "NAME"

   are indexed.

Version-Release number of selected component (if applicable):

   man-1.6f-4.fc9.i386


How reproducible:

   Always fails.


Steps to Reproduce:

   1. Note the word "shell" in the NAME section of the bash man page
      by running "man bash."

   2. apropos shell

   3. Note that bash man page is not reported.
  

Actual results:

   bash man page is not reported by "apropos shell."


Expected results:

   bash man page (and all other shell man pages) should reported by
   "apropos shell"


Additional info:

   The failure is due to makewhatis only stripping punctuation
   characters from the left edge of words while processing raw man pages
   and not those from the right edge.

   The bug is corrected by applying the following patch to
   /usr/sbin/makewhatis:

   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
   --- /usr/sbin/makewhatis-	2008-04-07 04:12:54.000000000 -0700
   +++ /usr/sbin/makewhatis	2008-07-10 07:21:51.000000000 -0700
   @@ -296,7 +296,9 @@
		 }
	       
		 while (!done && readline() > 0) {
   -		gsub(/.\b/, "");
   +		gsub(/.\b/, ""); # Remove punctuation adjacent to words,
   +		gsub(/\b./, ""); # such as the double quotes surrounding
   +				 # NAME in:  .SH "NAME"
		   if (($1 ~ /^\.[Ss][Hh]/ &&
		     ($2 ~ /[Nn][Aa][Mm][Ee]/ ||
		      $2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

   I recreated my whatis database using "makewhatis -w" and all shell
   man pages are now reported by "apropos shell."
Comment 1 Andrew Piziali 2008-07-18 09:27:31 EDT
One other data point: The implementation of makewhatis in Fedora Core 8 (man
version 1.6e, release 3.fc7) does not exhibit this bug.
Comment 2 Ivana Varekova 2008-07-21 07:41:30 EDT
Hello,
I just try to reproduce this bug, but I was unsuccessful. I used the same
version of man-package but 
apropos shell 
command works for me, please do you use makewhatis command before you run
apropos?. Could you attach /var/cache/man/whatis file which was generated.
Thanks.
Comment 3 Andrew Piziali 2008-07-21 08:38:52 EDT
> I just try to reproduce this bug, but I was unsuccessful.  I used the
> same version of man-package but apropos shell command works for me,
> ...

Just to confirm, you used man-1.6f-4.fc6?

> ... please do you use makewhatis command before you run apropos?

Yes.  As configured by default in Fedora 9, makewhatis is run both daily and
weekly.  Daily it is run by cron with the -u (update database) option while
weekly the full database is rebuilt.

> Could you attach /var/cache/man/whatis file which was generated?

With some effort, yes.  The machine is in a small town in Oregon that I was
visiting and I am now back in Texas.  I'll have to instruct the machine user on
how to revert makewhatis back to the version installed by man-1.6f-4.fc6,
backing out my fix, and manually run makewhatis as it is run by cron.  I will
post an update to this bug report and the attached /var/cache/man/whatis file
this week.

Thanks.
Comment 4 Ivana Varekova 2008-07-21 09:00:23 EDT
I test both man-1.6f-4.fc9 and the last man-1.6f-5.fc9.i386 versions - and in
both cases everything was ok.
Thanks for your effort.
Comment 5 Andrew Piziali 2008-07-22 19:44:00 EDT
Created attachment 312407 [details]
/var/cache/man/whatis

This is the /var/cache/man/whatis database rebuilt using the original
makewhatis distributed with man-1.6f-4.fc9.  Unfortunately it does not exhibit
the problem originally reported!  I reverted makewhatis on this Fedora 9 system
to the original version and will monitor any evidence that it fails to index
all man pages, both those that use   .SH NAME	and those that use   .SH
"NAME".
Comment 6 Ivana Varekova 2008-07-23 03:02:48 EDT
Thanks for your help. For now I will close this bug as worksforme but if you see
this problem again please reopen it and copy /var/cache/man/whatis here.

Note You need to log in before you can comment on or make changes to this bug.