Bug 13869

Summary: man(1) program saves multiple cached copies of the same file
Product: Base System Reporter: brett <brett>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description brett 1999-09-21 11:30:01 UTC
The "man" program doesn't recognize when multiple links exist to a file
containing a man page, and therefore creates multiple cached copies
of the formatted file. For example: /usr/share/man/man1/csh.1.gz and 
/usr/share/man/man1/fg.1.gz point to the same file. But when one 
types "man csh" and then "man fg", the file is formatted twice and
separate copies of the formatted output are created in 
/usr/share/man/cat1. This reduces the available cache space
and uses a great deal of extra cycles (groff is anything but
a lightweight utility).

Fix: 

There are several possible fixes. The easiest may be to change the
hard links in the various man directories into symlinks, and recode
man to follow the symlinks to the one "original" file name before
formatting and displaying it.
How-To-Repeat: Type "man csh" and "man fg". Note that the same page comes up in
either case, but that the system takes time to format it twice even
though the caching mechanism should prevent this. Next, look at
/usr/share/man/cat1 and note that there are two identical files
called csh.1.gz and fg.1.gz.
Comment 1 Sheldon Hearn 1999-09-21 11:36:45 UTC
On Mon, 20 Sep 1999 20:21:59 MST, brett@lariat.org wrote:

> The "man" program doesn't recognize when multiple links exist to a file
> containing a man page, and therefore creates multiple cached copies
> of the formatted file.

Yeah, but it's not a critical problem, given the size of the object
duplication we're talking about.

Mike Pritchard and I plan to teach man, whatis and friends to use a
proper database. That'll make this a moot point.

Ciao,
Sheldon.
Comment 2 Sheldon Hearn freebsd_committer freebsd_triage 1999-09-21 11:36:53 UTC
State Changed
From-To: open->suspended

There are plans to introduce an improved index management system 
into the man family. The implementation will make this a non-issue. 


Comment 3 Sheldon Hearn freebsd_committer freebsd_triage 1999-09-21 11:36:53 UTC
Responsible Changed
From-To: freebsd-bugs->sheldonh

I'll come back and close this when we're done. :-) 

Comment 4 brett 1999-09-21 16:10:00 UTC
Good! It'll be nice to move this away from GNU software as well.

The main type of wastage, under the current system, is not really
space but programmers' and users' time. The system has to send more 
things through groff, which is a CPU and memory hog even on our 
fastest machines. I drum my fingers waiting for man pages to appear
even on our new Athlon  server.

What's more, the cache is filled more quickly, so man pages must
be passed through groff more often.

A better indexing system would be most welcome! Let me know if you'd
like some help doing indexing, as I have indexed books before.

--Brett

At 12:36 PM 9/21/99 +0200, Sheldon Hearn wrote:


>On Mon, 20 Sep 1999 20:21:59 MST, brett@lariat.org wrote:
>
> > The "man" program doesn't recognize when multiple links exist to a file
> > containing a man page, and therefore creates multiple cached copies
> > of the formatted file.
>
>Yeah, but it's not a critical problem, given the size of the object
>duplication we're talking about.
>
>Mike Pritchard and I plan to teach man, whatis and friends to use a
>proper database. That'll make this a moot point.
>
>Ciao,
>Sheldon.
Comment 5 Sheldon Hearn freebsd_committer freebsd_triage 2001-11-27 18:23:34 UTC
Responsible Changed
From-To: sheldonh->freebsd-bugs

I lost interest, given that this would be yet another local patch 
to consider when upgrading GNU man.
Comment 6 Alexander Best freebsd_committer freebsd_triage 2011-02-14 00:05:24 UTC
State Changed
From-To: suspended->patched

With the introduction of the shiny new man(1) script by gordon@, duplicates are 
no longer an issue. Once it gets MFC'ed to stable/8 and stable/7 goes EoL, we 
can finally close this ancient PR. ;)
Comment 7 Eitan Adler freebsd_committer freebsd_triage 2012-11-02 22:17:45 UTC
State Changed
From-To: patched->closed

MFCed by now or it is never going to be