From owner-cvs-all Fri Aug 28 22:34:24 1998 Return-Path: Received: (from daemon@localhost) by hub.freebsd.org (8.8.8/8.8.8) id WAA13855 for cvs-all-outgoing; Fri, 28 Aug 1998 22:34:24 -0700 (PDT) (envelope-from owner-cvs-all) Received: from word.smith.net.au (castles244.castles.com [208.214.165.244]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id WAA13848 for ; Fri, 28 Aug 1998 22:34:20 -0700 (PDT) (envelope-from mike@word.smith.net.au) Received: from word.smith.net.au (localhost [127.0.0.1]) by word.smith.net.au (8.9.1/8.8.8) with ESMTP id WAA00736; Fri, 28 Aug 1998 22:31:29 GMT (envelope-from mike@word.smith.net.au) Message-Id: <199808282231.WAA00736@word.smith.net.au> X-Mailer: exmh version 2.0.2 2/24/98 To: "Jordan K. Hubbard" cc: Mike Smith , committers@FreeBSD.org Subject: Re: make.conf In-reply-to: Your message of "Fri, 28 Aug 1998 19:10:31 MST." <23567.904356631@time.cdrom.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 28 Aug 1998 22:31:28 +0000 From: Mike Smith Sender: owner-cvs-all@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk > For rc.conf and make.conf, which contains only variable declarations, > this is actually pretty easy since you really just have to: > > 1. Read in the new file, preserving comments and storing all the > name/value pairs in some sort of table (sysinstall actually does > this now). > > 2. Read just the name/value pairs from the old file and override > any existing values in the table with the previous data. > > 3. Write back out a composite file with comments and updated variable > values. > > Erm, right? I don't see any reason why that wouldn't work unless the > default value of something has changed and you end up propagating an > old default value back into your new file. I guess that's the one > downside to this approach. The lossage associated with this scheme is as follows: - Variant/nonstandard entries (eg. ifconfig_foo in rc.conf) require special handling. - Unless you associate comments with variables, and know how to differentiate between "system" comments and "user" comments, any additional commentary added by the user is lost. - It's difficult to tell the difference between a "local addition" and an obsoleted variable. You can work around this by mandating that anything nonstandard must not be kept in the datafile. My old Juliet framework knows how to do most of this (add, remove, comment association, etc.). make.conf is basically the same format, so the same code could be used with trivial modifications. If someone will trade me a trivial commandline parser (turn string into argv/argc, handle \ and " and $ substitution properly), I'll rewrite the Juliet code to suit. -- \\ Sometimes you're ahead, \\ Mike Smith \\ sometimes you're behind. \\ mike@smith.net.au \\ The race is long, and in the \\ msmith@freebsd.org \\ end it's only with yourself. \\ msmith@cdrom.com