config files in packages (Re: (proposal) new flag forpkg_delete)
davidt at yadt.co.uk
Mon Sep 8 18:02:27 PDT 2003
On Mon, 08 Sep 2003, Adam C. Migus wrote:
> I have been playing with your package for a little while now. I
> like it so far and was waiting to see if you had anything else in
> the way of enhancements for it prior to commenting (as you've only
> released 0.2 thus far). You're point about the base install didn't
> bother me as I was using it for diskless installations.
> I like both of your ideas, adapting it for ports and for sysinstall.
> Have you received any feedback? Are there any known bugs or
> limitations in the current revision that might preclude
> experimentation with doing this now?
I'm currently (very slowly) working on an idea (as I posted somewhat
hastily earlier this thread). The basic idea for merging is the same as
Eivind's, but I took a different approach to getting the 'reference'
Basically, port Makefiles would list config files in a format something
CONFIG_FILES= foo.cfg:etc/foo/foo.cfg \
(It's too late to be inventive with filenames, sorry :)
I need to work out exactly how the ports/package system can find the file,
but my current idea is to have the ports/package system install
etc/foo/foo.cfg.dist and etc/foo/bar/foo.cfg.dist (with a CONFIG_SUFFIX
defaulting to .dist), then have the ports .mk files and a plist @config
command handle the rest.
That is, the ports/package system would install the default config file if
no other config file existed, or the last user-created config file if one
existed. It would also store the installed version in an RCS file
(e.g. /var/db/pkg/<package>/cfg/bar_foo.cfg,v). The installed/merged
versions would then be stored on a branch off of the 'reference' file it
was last merged up to.
On uninstallation, pkg_delete would, as currently, delete the .dist file,
store the latest user file in the RCS file, and remove the config file.
I've just realised that storing the RCS files in /var/pkg/db/<package>
would result in them being deleted after an upgrade, so perhaps they need
to be stored elsewhere. They'd also need to use /usr/ports/MOVED or
similar to handle changing package names.
However, I have (I think) worked out a way of doing this that would be
backwards compatible. The pkgcfg_merge script could be set to use
simple mergemaster style merging (ignore the 'reference' file and merge
the new vs installed files), or a smarter diff3 style merging.
The only change required to ports would be:
Config files should be listed in CONFIG_FILES= (or whatever it
Distributed config files _must_ be installed with CONFIG_SUFFIX
(or whatever) as a suffix, to avoid overwriting stuff.
The base system could either be handled as a special case (with a seperate
db dir), or as a 'fake' package of some form.
Hopefully, this makes more sense than my last mail about this.
(I am still planning on creating/submitting a pkg_delete patch, but
this was more interesting, so bumped it down my todo list a bit)
davidt at yadt.co.uk
"The future just ain't what it used to be"
More information about the freebsd-arch