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

Freddie Cash fcash at ocis.net
Sun May 28 21:25:41 PDT 2006


On Fri, May 26, 2006 11:53 pm, Doug Barton wrote:
> 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:

Yes, the port will work with all the default config files, right off
the bat.  I just haven't installed any of them without the .dist
suffix as I hadn't figured out a nice way to do upgrades without
overwriting all the customisations done by the user.

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

I'm guessing that would go into the post-install: target of the port's
Makefile.  Or would it go into a pkg-install script?

> 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.

That was the other part I was looking at.

Thanks to all for the pointers to ports to look at.  Now I'll
something to do this week.  :)

----
Freddie Cash
fcash at ocis.net



More information about the freebsd-ports mailing list