Bug 454880

Summary: makewhatis does not index all man pages.
Product: [Fedora] Fedora Reporter: Andrew Piziali <andy>
Component: manAssignee: Ivana Varekova <varekova>
Status: CLOSED WORKSFORME QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 9   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-07-23 07:02:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
/var/cache/man/whatis none

Description Andrew Piziali 2008-07-10 14:48:38 UTC
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 13:27:31 UTC
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 11:41:30 UTC
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 12:38:52 UTC
> 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 13:00:23 UTC
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 23:44:00 UTC
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 07:02:48 UTC
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.