From owner-cvs-all@FreeBSD.ORG Tue Apr 12 22:35:06 2005 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E5BDF16A4CF; Tue, 12 Apr 2005 22:35:06 +0000 (GMT) Received: from mail.soaustin.net (mail.soaustin.net [207.200.4.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 326F143D49; Tue, 12 Apr 2005 22:35:06 +0000 (GMT) (envelope-from linimon@lonesome.com) Received: by mail.soaustin.net (Postfix, from userid 502) id 4E6EF1492B; Tue, 12 Apr 2005 17:35:05 -0500 (CDT) Date: Tue, 12 Apr 2005 17:35:05 -0500 (CDT) From: Mark Linimon X-X-Sender: linimon@pancho To: John Baldwin In-Reply-To: <200504121315.47608.jhb@FreeBSD.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Mark Linimon cc: src-committers@FreeBSD.org cc: cvs-src@FreeBSD.org cc: cvs-all@FreeBSD.org cc: Alexander Leidinger Subject: Re: cvs commit: src/usr.sbin/sysinstall config.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2005 22:35:07 -0000 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