[comp.sys.mips] MANPATH misbehaviour

lamy@sobeco.com (Jean-Francois Lamy) (09/22/90)

If I export MANPATH=/local/man:/usr/man and put a man page in
/local/man/man1/rcs.1, /usr/bin/man rcs will show me the /usr/man man page for
rcs first, and the /local/man man page second, something I'd consider strongly
undesirable.  The BSD man will show me the /usr/man version only.

Thinking this might be caused by a silly algorithm whereby "cat" pages
get searched thouroughly before "man" pages, I tried creating a
/local/man/cat1/rcs.1, to no avail.

While I'm whining about man I would dearly love to hear what the rationale
behind the /usr/man disorganisation is, especially why "cat" format man
pages are now in the place where one would expect "man" format man pages to be.

Oh well.  Nothing a freely-redistributable source version of man can't fix.
Except I shouldn't have to go through this just because I want to run versions
of programs that are more recent than what Mips ships and have man pages that
match them... (no, overwriting the man pages in /usr is not an acceptable
solution)

-- Lamy, grumpy.

cprice@mips.COM (Charlie Price) (09/23/90)

In article <1990Sep22.032115.23562@sobeco.com> lamy@sobeco.com (Jean-Francois Lamy) writes:
>If I export MANPATH=/local/man:/usr/man and put a man page in
>/local/man/man1/rcs.1, /usr/bin/man rcs will show me the /usr/man man page for
>rcs first, and the /local/man man page second, something I'd consider strongly
>undesirable.  The BSD man will show me the /usr/man version only.
>
>Thinking this might be caused by a silly algorithm whereby "cat" pages
>get searched thouroughly before "man" pages, I tried creating a
>/local/man/cat1/rcs.1, to no avail.
>
>While I'm whining about man I would dearly love to hear what the rationale
>behind the /usr/man disorganisation is, especially why "cat" format man
>pages are now in the place where one would expect "man" format man pages to be.

MIPS' man command is not our best feature, and I won't try to defend it.
I can, however, help you to get local copies of pages printed first.

Why don't we ship man "source code"?
This is not gospel, and I'm sure I don't understand the precise details,
but I *believe* that the man "source" is a separately licensed package
under the AT&T license and that we (hence presumably you) would have to
pay some additional license fee if you got it.
I think it should be available as an optional product from MIPS,
and if you think that too, you should mention that loudly and often
to the people you buy the machines from and our customer service people.
Mentioning it to me won't help.

Now about "local" man pages...
This will work the way you want, presenting the local copy first,
if you have your local man page hierarchy model the man page hierarchy
that we ship.  If you look at /usr/man you see:

% ls /usr/man

   a_man   catman  p_man   u_man   whatis  x_man

and what is in, for instance, p_man?

% ls -l /usr/man/p_man

   bsd_man2    bsd_man4    man2        man4        posix_man2  posix_man5
   bsd_man3    bsd_man5    man3        man5        posix_man3

and the man pages themselves are in these directories (but look to
see exactly what there is).
So if you want your man page to be seen before a standard page,
it has to be in the same place in the hierarchy as man sees it.

An additional directory that can exist for "local" pages is l_man.

Now if you looked more closely, you would discover that we don't
really have any source code and that we "fake out" man by
the following stragem.

% ls -l /usr/man

   total 170
   lrwxrwxrwx   1 bin      bin           12 Aug 31 09:03 a_man -> catman/a_man
   drwxrwxr-x   5 bin      bin          512 Feb  2  1990 catman
   lrwxrwxrwx   1 bin      bin           12 Aug 31 09:03 p_man -> catman/p_man
   lrwxrwxrwx   1 bin      bin           12 Aug 31 09:03 u_man -> catman/u_man
   -r--r--r--   1 bin      bin        82880 Aug 23 10:28 whatis
   l---------   1 bin      bin           12 Aug 31 08:51 x_man -> catman/x_man

and (squeezed a little bit)

% ls -l /usr/man/catman

   total 4
   drwxr-xr-x   7 bin      bin          512 Aug  8 10:41 a_man
   drwxr-xr-x  13 bin      bin          512 Feb  2  1990 p_man
   drwxr-xr-x   7 bin      bin          512 Feb  2  1990 u_man
   l---------   1 bin      bin     17 Aug 31 08:51 x_man -> ../../X11/man/cat

so the standard hierarchy has top-level directories that symlink into catman
and the subdirectories of catman have the actual output-format man pages.

You *can* have an identical hierarchy and have only catman format files,
but if you have man page source, build a regular hierarchy.
To make this concrete using the example in the article above,
your MANPATH would be set as suggested to "/local/man:/usr/man",
you would need to have a couple directories:
 /local/man/u_man/man1 /local/man/catman/u_man/man1
and the local rcs man page source would go in
 /local/man/u_man/man1/rcs.1

-- 
Charlie Price    cprice@mips.mips.com        (408) 720-1700
MIPS Computer Systems / 928 Arques Ave. / Sunnyvale, CA   94086-23650