Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Dec 2001 10:18:58 +0200
From:      Ruslan Ermilov <ru@FreeBSD.org>
To:        Greg Lehey <grog@FreeBSD.org>
Cc:        Garance A Drosihn <drosih@rpi.edu>, Peter Wemm <peter@wemm.org>, Nik Clayton <nik@FreeBSD.org>, Warner Losh <imp@harmony.village.org>, ache@FreeBSD.org, freebsd-arch@FreeBSD.org
Subject:   Re: Changing 'man' to check alternate destination for 'cat' pages
Message-ID:  <20011214101857.C35094@sunbay.com>
In-Reply-To: <20011214112255.L3448@monorchid.lemis.com>
References:  <20011212001610.9AEA739EA@overcee.netplex.com.au> <p0510100bb83ddfa9e683@[128.113.24.47]> <20011214112255.L3448@monorchid.lemis.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Dec 14, 2001 at 11:22:55AM +1030, Greg Lehey wrote:
> On Thursday, 13 December 2001 at  0:01:03 -0500, Garance A Drosihn wrote:
> > From the thread
> >    Re: Getting rid of /usr file system (was: Using a larger block size...)
> >
> >>> On Tue, Dec 11, 2001, Garance A Drosihn wrote:
> >>>> In the land of weird suggestions, just how weird would it be to
> >>>> suggest that we create some way for 'cat' versions of man pages
> >>>> to land somewhere else?
> >>>>
> >>>> Maybe /var/man/usr/share/cat*
> >>>> for ones from /usr/share/man/man*
> >>>> etc?
> >
> > Given that Peter, Nik, and Greg expressed some interest, I thought it might
> > be interesting to try my hand at doing it.  I looked at it for about 15
> > minutes tonight, and noticed that 'man' is under gnu/usr.bin.  Does that
> > imply changes for it should go thru gnu, somehow?    <<shudder>>
> 
> No, there's no obligation to submit changes to the GNU project.  If
> you think it would be worthwhile for them, you can do so, however.
> 
> > I noticed there are some changes to 'man' in release 5 which haven't
> > been MFC'ed yet.  Would there be any reason those should not be
> > MFC'ed?
> 
> Your call.  I'd guess that nobody felt motivated enough.
> 
> > Should I try my hand at implementing my idea, or is someone else
> > already looking into it?
> >
> > While I haven't tried writing any code yet, my intent is that
> > 'man <thing>' would do something like:
> >
> >      search for the requested man page (same as it does now)
> >      once it finds the location, then
> >   +      look for a 'cat' page at /<matchedpath>/cat/thing.n,
> >   +          if found, use it
> >          look for a 'cat' page at /var/man/<matchedpath>/cat/thing.n,
> >              if found, use it
> >   +      see if /var/man/<matchedpath>/cat is an existing directory,
> >   +          if so, then put the expanded 'man' page into that directory.
> >          otherwise put it in /<matchedpath>/cat (as happens now)
> >
> > Does this sound about how people would want it to work?  Basically the
> > idea is that it would work exactly the same as it does now, except for
> > the steps with a '+' on them.  So, to get this alternate behavior people
> > would have to create the appropriate directories under /var/man (or
> > perhaps some other name), such as:
> >     /var/man/usr/share/man/cat*
> >     /var/man/usr/local/man/cat*
> >     /var/man/usr/X11R6/man/cat*
> >
> > I haven't done any work on this yet, I'm just looking for feedback.
> 
> If you're going to overhaul man, there's probably quite a bit you
> could do beyond the paths.  I had a man years ago which would list which
> man pages were present (note that my MANPATH is:
> 
>   MANPATH=/usr/local/man:/usr/share/man:/usr/X11R6/man:/usr/share/man/BSDI-5:/usr/share/man/4.4BSD:/usr/share/man/BSDI:/usr/share/man/V6:/usr/share/man/V7:/usr/share/man/3bsd:/usr/share/man/2.11BSD:/usr/share/man/IRIX-5.3/u_man:/usr/share/man/IRIX-5.3/p_man:/usr/share/man/IRIX-5.3/a_man:/usr/share/man/IRIX-5.3/g_man:/usr/share/man/ISC-3.2/p_man:/usr/share/man/ISC-3.2/u_man:/usr/share/man/NonStop-UX-B23:/usr/share/man/NonStop-UX-C10:/usr/share/man/SCO-3.2.2:/usr/share/man/SCO-3.5.0:/usr/share/man/SVR4.2:/usr/share/man/Solaris-2.5:/usr/share/man/SunOS-4.1.3:/usr/share/man/Xenix-2.3.2
> 
> Under these circumstances it's interesting to know which man pages you
> have, and where they are.  It also had a 'query' option: 
> 
>   $ man -q ls
>   -r--r--r--  1     root    wheel         5361 Sat Sep 30 17:13:47 2000 /usr/share/man/man1/ls.1.gz? n
>   -rw-r--r--  1     root    wheel         3062 Thu Aug 18 21:45:13 1994 /usr/share/man/4.4BSD/cat1/ls.1.gz? n
>   -r--r--r--  1      bin      bin         9435 Tue Jan 21 00:17:30 1997 /usr/share/man/BSDI/man1/ls.1? n
>   -rw-r--r--  1     root    wheel         2271 Fri Aug 25 23:54:06 2000 /usr/share/man/linux/man1/ls.1.gz? n
>   -rw-r--r--  1     root    wheel         4903 Fri Dec 10 09:30:51 1999 /usr/share/man/linux/man1/ls.1? n
>   -rw-r--r--  1      bin      sys         3354 Fri Jun 27 10:05:42 1975 /usr/share/man/V6/man1/ls.1? 
> 
What are you looking for is already available as:

$ MANPATH=/home/ru/mann:/usr/share/man man -a -w ls
/home/ru/mann/man1/ls.1
/usr/share/man/cat1/ls.1.gz (source: /usr/share/man/man1/ls.1.gz)
$ man -a -w dirname
/usr/share/man/cat1/dirname.1.gz (source: /usr/share/man/man1/dirname.1.gz)
/usr/share/man/cat3/dirname.3.gz (source: /usr/share/man/man3/dirname.3.gz)

> As regards the cat files, it seems to me that an obvious solution
> would be to add a CATMAN environment variable which would specify the
> location of the catman pages, and default to /usr/share/man/cat.
> 
Just having a CATMAN envariable is not enough, this would break many things.
There are hosts on which people use different locales simultaneously.  Look
at how the usr/share/man/en.ISO8859-1 is organized nowadays, and realize
why, while sharing the man? directories with the .., it has its own cat?
directories.

The "cat" feature of man(1) is insecure, and is probably going to be
nuked after a release of 4.5.

Having catpages:

- is optional
- can be configured at ``make world'' time
- in different place can be achieved by using symlinks to cat?.


Cheers,
-- 
Ruslan Ermilov		Oracle Developer/DBA,
ru@sunbay.com		Sunbay Software AG,
ru@FreeBSD.org		FreeBSD committer,
+380.652.512.251	Simferopol, Ukraine

http://www.FreeBSD.org	The Power To Serve
http://www.oracle.com	Enabling The Information Age

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011214101857.C35094>