Don't Overwrite Config files

Joshua Root jmr at
Wed Jan 18 05:49:42 UTC 2017

On 2017-1-18 15:25 , Teddy Thomas wrote:
> I’m trying to write a Macport that will install some config files in
> /etc, and I’m wondering what the best way is to prevent overwriting user
> customized files is, and to put the system config files back the way
> they were when uninstalling the port. I looked in the Portfile best
> practices (
> <>) and
> found section 4.7.2, but it’s listed as a TODO. Any insight anyone can
> provide would be most appreciated. I’d be happy to contribute
> documentation with a way forward. Thanks in advance.


Ports should in general keep their configuration files in ${prefix}/etc, 
not /etc. Modifying system config files tends to be a bad idea, not 
least because they may be modified by users and OS updates, so putting 
them back the way they were is not necessarily correct. Not changing 
existing files and letting the user deal with updating them is about the 
only tractable approach.

- Josh

More information about the macports-dev mailing list