Re: config files in packages (Re: (proposal) new flag forpkg_delete)

From: David Taylor (davidt_at_yadt.co.uk)
Date: 09/09/03

  • Next message: Doug Rabson: "When to burn those bridges"
    Date: Tue, 9 Sep 2003 02:02:17 +0100
    To: freebsd-arch@FreeBSD.ORG
    
    

    On Mon, 08 Sep 2003, Adam C. Migus wrote:
    [snip]
    >
    > 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'
    config files.

    Basically, port Makefiles would list config files in a format something
    like:

    CONFIG_FILES= foo.cfg:etc/foo/foo.cfg \
                  bar_foo.cfg:etc/foo/bar/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
              gets called)
            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)

    -- 
    David Taylor
    davidt@yadt.co.uk
    "The future just ain't what it used to be"
    _______________________________________________
    freebsd-arch@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-arch
    To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
    

  • Next message: Doug Rabson: "When to burn those bridges"

    Relevant Pages

    • Re: Conventions for NFS sharing of binaries
      ... I installed a package in /usr/local which would ... if a shared package puts a config file in a shared ... >> If I want to install a different version of a software from source ... the RPM version or the ...
      (comp.os.linux.misc)
    • Re: Upgrading SVR4 packages and config files
      ... unwanted_new_config and install your personal favorites. ... I was asking what the package creators do to automate the process, ... Today I packaged the thing which delivers config file in .etc and then ... postinstall script copies it to etc. ...
      (comp.unix.solaris)
    • Re: Re-build Kernel 2.4.18(RH8.0)
      ... What I did is just install the package from RH CDs and run ... good .config file in /usr/src/linux-2.4.whatever; ... interface, or "make xconfig" and using the X-based menu interface. ...
      (comp.os.linux.misc)
    • Trouble with installer RC1
      ... Yesterday, February 2, I did an ordinary install with etch netinstall ... In the package selection phase I requested no desktop environment, ... Installing new version of config file /etc/init.d/networking ... not even the standard system. ...
      (Debian-User)
    • Errors applying kernel patch 118833-36
      ... install of Solaris 10 11/06. ... However, once the package list is done, I see a worrisome message: ... Below is the complete console output of the patch run. ... Changes for package SUNWnfsskr will not be applied to the system. ...
      (SunManagers)