cvs commit: src/usr.sbin/sysinstall config.c

Mark Linimon linimon at lonesome.com
Tue Apr 12 15:35:07 PDT 2005


On Tue, 12 Apr 2005, John Baldwin wrote:

> That's the problem.  What other algorithm are you going to propose than 
> first-match?

I don't know, exactly.  There are only 5 hard-coded strings being
passed to package_add.  Let me think out loud.

The crudest approach would be to create something like latestPackages.h
which would have

  #define	LATEST_PACKAGE_LINUX_BASE	"linux_base-8"

and that at least gets the magic out of the C code.  A recompile
is still needed, though.  This is gross but low-risk.

The next approach would be to prefix each of those 5 calls by
a new call, get_latest_link, which would walk a list of pairs of
strings and either return the righthand side if the lefthand
side matched, or the original argument, and then come up with
some file format like

  linux_base|linux_base-8

to initialize the set of strings.  Then, of course, you have
to read that file, deal with it being missing, blah blah blah.

Neither approach seems particularly attractive but anything more
thorough would be a lot heavier weight.

Since I'm several weeks behind in my own committments, all I
could do is offer to whip up patches for the first approach and
see if I can generate exactly the same bits from the compile.

mcl



More information about the cvs-src mailing list