Subject: Re: Alternatives system, 2nd round
To: Jeremy C. Reed <reed@reedmedia.net>
From: Julio M. Merino Vidal <jmmv84@gmail.com>
List: tech-pkg
Date: 01/21/2005 21:15:28
On Fri, 2005-01-21 at 11:59 -0800, Jeremy C. Reed wrote:
> On Fri, 21 Jan 2005, Julio M. Merino Vidal wrote:
>
> > On Fri, 2005-01-21 at 09:59 -0800, Jeremy C. Reed wrote:
> > > How does it generate the man pages? And how do users use the man pages?
> > > (do they have to look twice?)
> >
> > It is based on a template that basically says "this is a wrapper program
> > for this other utility. use the following command to see which binary
> > it's pointing to and then see its man page". Check the wrapper.man file
> > included in the tarball.
>
> I don't understand how this is easier than using the .so macro to simply
> load the other man page.
Lets continue with the typical example I'm always using; nvi and vim.
Both are installed in your system and nvi is the default. This'd mean
that vi.1 could be .so'ing nvi.1 and the vi wrapper could be running
nvi. Ok.
Now say our Joe User changes the alternative in his personal
configuration:
$ alternatives manual bin/vi /usr/pkg/bin/vim
What will happen is that the vi wrapper will see his configuration
and vim will be executed. But the manual page will still be pointing
to nvi.
However, another user could not have any setting and so he will see
vi run nvi, and vi.1 show nvi.1.
The .so trick could be good if the wrappers were static: i.e., run
this program and only this one. Don't ever try to use a fallback.
But this is not what's happening (and in fact, this is one of the
reasons why wrappers look like a better solution).
Cheers,
--
Julio M. Merino Vidal <jmmv84@gmail.com>
http://www.livejournal.com/users/jmmv/
The NetBSD Project - http://www.NetBSD.org/