Good examples of not deleting custom config files/installing new config files

Doug Barton dougb at FreeBSD.org
Fri May 26 23:53:33 PDT 2006


Freddie Cash wrote:
> Could someone point me to some ports that do a good job of not
> deleting custom config files when you do updates?  I'd like to
> incorporate something similar into my ports.  Currently, I just
> install everything with a .sample and put a note in the pkg-message. 
> Which works great for upgrades, but not for the initial install.  And
> as my ports go into the "multiple-dozens of config files in multipls
> sub-directory" area, it's getting to be a pain for the users to copy
> files around.

You've already had some good answers, but I'd like to add something if I
may. You left out a very important aspect of this issue, which is whether or
not your stuff will run with the default config files or not. If so,
something as simple as:

for file in `find /usr/local/etc/port -type f`; do
	if [ ! -s "${file%.sample}" ]; then
		cp -p $file ${file%.sample}
	fi
done

Will handle the initial installation. As a user I also appreciate those
ports that compare the installed version of a config file to the .sample
version, and delete both if they are the same. It makes cleaning up after a
deinstallation (and archiving during an upgrade) a lot easier.

hth,

Doug

-- 

    This .signature sanitized for your protection



More information about the freebsd-ports mailing list