about (config) files created in the post-activate stage

Ryan Schmidt ryandesign at macports.org
Sat Sep 26 19:02:43 PDT 2015


On Sep 25, 2015, at 08:19, René J.V. Bertin wrote:

> AFAIK it is acceptable practice to create things like configuration files in a port's post-activate, and I presume that those files are not obliged to have fixed names and that they can reflect the context (including installed ports) at the time of creation.
> 
> Is there a way to add certain of those files to the list of files to be cleaned up, either when deactivating a port or else in a pre-activate step?

Current accepted behavior with regard to config files is that if a port provides config files, they must be installed in the destroot with a name and/or location different from the one that the program will use. For example, if the program will read /opt/local/etc/foo.conf, then the port must not install that file in the destroot. It must instead install nothing, or must install /opt/local/etc/foo.conf.sample or /opt/local/etc/foo.conf.dist or something like that. Then in post-activate, if /opt/local/etc/foo.conf does not exist, the port may copy the sample file to that location and advise the user that they may edit that file. There is currently no provision for MacPorts to later remove files created that way. The request to improve this situation is:

https://trac.macports.org/ticket/2365



More information about the macports-dev mailing list