Subject: Re: Package Paths Proposal v2
To: NetBSD Packages Technical Discussion List <tech-pkg@netbsd.org>
From: Curt Sampson <cjs@cynic.net>
List: tech-pkg
Date: 12/16/1998 13:01:29
On Wed, 16 Dec 1998, Greg A. Woods wrote:
> > 1. The package, when compiled, always looks in /etc and /var for
> > the files appropriate to those directories.
>
> I'd like there to be a switch here to permit $PREFIX/etc and/or
> $PREFIX/var as the place to look.
There's no way to switch these at run time with many packages,
anyway, because the paths are compiled directly into the binaries.
Your choices are basically the following:
/etc for config files
/var for spool
/usr/pkg/{bin,sbin,share,etc.} for everything else
which means that /etc and /var can't change, or
/pkg/etc for config files
/pkg/var for spool
/pkg/usr/{bin,sbin,share,etc.} for everything else
which means that they can.
With the former proposal you *always* know that *all* your config
files are in /etc. This is a good thing.
With the latter, you can get the same result either with
/pkg -> /
or with
/pkg -> (whatever)
/pkg/etc -> /etc
/pkg/var -> /var
> > 2. Packages are set up to place `fresh' or `example' etc and var
> > files in /usr/pkg/share/examples/<pkgname>/{etc|var}. Nothing is
> > placed in /etc or /var.
>
> Is it possible to rename these files to <config>.old when a pkg_add
> simply "upgrades" a package too?
Sure, it could do the same step that pkg_delete does:
> > 5. pkg_delete, when run, does not remove /usr/pkg/share/examples/<pkgname>,
> > but instead renames it to <pkgname>.old. This is so that one can
> > diff the files after uninstalling one version and installing a new one.
I didn't know that pkg_add had an upgrade option now; that's why
I didn't include this.
> Does pkg_delete remove the /etc (or $PREFIX/etc) files associcated with
> a package too? (I think it should.)
I think it definitely should not. If I pkg_delete ssh, I should
not lose my irreplacable ssh private key, especially because it
may be deleted becase I'm installing my own compile of the program.
Nor should I lose potentially hard to rewrite configuration files.
I consider /etc to be sacred. Programs should be *extremely*
conservative about changing or deleting files in there.
cjs
--
Curt Sampson <cjs@cynic.net> 604 801 5335 De gustibus, aut bene aut nihil.
The most widely ported operating system in the world: http://www.netbsd.org