Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Aug 1998 22:31:28 +0000
From:      Mike Smith <mike@smith.net.au>
To:        "Jordan K. Hubbard" <jkh@time.cdrom.com>
Cc:        Mike Smith <mike@smith.net.au>, committers@FreeBSD.org
Subject:   Re: make.conf 
Message-ID:  <199808282231.WAA00736@word.smith.net.au>
In-Reply-To: Your message of "Fri, 28 Aug 1998 19:10:31 MST." <23567.904356631@time.cdrom.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
> 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





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199808282231.WAA00736>