Subject: Re: pkg_alternatives as a dependency, again
To: Julio M. Merino Vidal <jmmv84@gmail.com>
From: Greg A. Woods <woods@weird.com>
List: tech-pkg
Date: 02/14/2005 13:20:10
[ On Saturday, February 12, 2005 at 10:46:31 (+0100), Julio M. Merino Vidal wrote: ]
> Subject: Re: pkg_alternatives as a dependency, again
>
> If someone wants to have a system-wide 'java' command that just works,
> even when there is a single vm available, what?

A one-line wrapper script will suffice.

>  This was impossible to
> do in pkgsrc, aside from the ugly and too-specific java-wrapper package.

There need not be anything too application specific in a truly simple
wrapper script.

Generically speaking about a java VM though is probably a very bad
example.  It would be like wishing to have a generic "perl" that spanned
versions 1.x-5.x.

Like I said, it's a no-brainer to wrap a bug-for-bug-compatible
replacements, but when there isn't even any resemblence of a compatible
command-line API, as there is not between the two main variants of java
runtime engines, well, then even trying to pretend that a generic
wrapper script can cover them is hopeless.

> > If anyone really wants to provide some mechanism for "packaging"
> > "standardized" command names for alternative commands (e.g. for
> > supporting pkgsrc on those poor desolate systems which might not have
> > one's favorite NetBSD features, including those built using pkgsrc for
> > their entire userland from scratch) then the only right way to do that
> > is with a meta package that just installs a symlink
> 
> ... which is NOT binary friendly ...

Yes, it IS, and that's the whole point of having runtime dependencies
registered.

> >  or a tiny,
> > configurable, wrapper script (and perhaps depends on the target file's
> > package(s)) to (default to) a name chosen at compile time.
> 
> and we are back at alternatives.  If you are going to have tens of
> packages providing wrappers, you can merge them all in one (i.e.,
> pkg_alternatives), which has a common interface among all of them.

I'm not opposed to having a single "generic" one-line wrapper script
template that can be used for all packages.  That's fine, though perhaps
a wee bit extreme when it comes to forcing code reuse.

What I really detest is the idea that these things should be runtime
configurable, and even worse be user-specific.  That is insanity of the
worst kind as it invents yet another system-specific bit of magic that
hardly anyone will ever understand, and nobody else will ever use.

DO NOT REINVENT THE WHEEL!  There are already almost an infinite supply
of common, well understood, widely used, techniques for users to alias
commands.

-- 
						Greg A. Woods

H:+1 416 218-0098  W:+1 416 489-5852 x122  VE3TCP  RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com>          Secrets of the Weird <woods@weird.com>