Subject: Re: pkg_alternatives as a dependency, again
To: Julio M. Merino Vidal <>
From: Todd Vierling <>
List: tech-pkg
Date: 02/10/2005 20:42:33
On Thu, 10 Feb 2005, Julio M. Merino Vidal wrote:

> How could we decide which package is the preferred one for a given
> alternative?  Should there be multiple levels of preference?  (I.e.,
> assign them a number and, the lower it is, the more preference it
> has?)  Or just have a single default?  (E.g., nvi for vi, uwpico for
> pico, etc.)

nvi != vi, but uwpico == pico.  My take on this is that the only true
"overriding default" would be a package that was named that in the first
place; all others take a back seat.  That said:

> We might even modify pkg_alternatives' default configuration file to
> ignore some wrappers (i.e., 'vi'), as many people were against that
> one specifically.

I got an offlist reply about this, too, and I believe that the problem is
really the shadowing of "system" binaries.

So, perhaps a real priority-based system is appropriate, with the following
order of precedence when in "auto" mode:

1. If a package is installed which is *normally* that alternative's name
   (bin/pico from pico, but NOT bin/vi from nvi), use that.  This follows
   historical usage, since these are the "real" alternative names.

2. If an alternative lives in a system directory (/ or /usr -- note that
   "bin/" is part of the alternative name), use that.[*]  This shadows the
   system binary, but only with a wrapper deferring to the system binary.

3. User-configured priorities (NOT currently in this proposal, as this is
   much more complicated to add).

4. Sequential attempts iterating through the rest of the alternative's
   config file, as today.

[*] The system dirs might be configurable in a .conf file, defaulting to /
    and /usr, with a check in pkgsrc to skip /usr in the default generated
    .conf if LOCALBASE=/usr.  This would allow, for instance, adding /opt or
    /usr/local to the system dir override path.

-- Todd Vierling <> <>