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

Ryan Schmidt ryandesign at macports.org
Sun Sep 27 01:50:50 PDT 2015


> On Sep 27, 2015, at 3:28 AM, René J.V. Bertin <rjvbertin at gmail.com> wrote:
> 
> On Saturday September 26 2015 21:02:43 Ryan Schmidt wrote:
> 
>> 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. 
> 
> That's not really relevant for my usage case (port:qtchooser) and could actually mean that an inappropriate config file is installed. These config files just summarise what Qt ports are installed currently and where and is not supposed to be user-editable.

What I said applies to config files that are meant to be user-editable. Config files that aren't user-editable are no different from any other file installed by a port.

> I'm not even sure there's support for adding comments in them. There's a provision to regenerate them through the port's binary though, and to add configuration profiles ("environments") with a different name and referring to any Qt install you want. So  find it preferable to have a few reserved environments that are not supposed to be user-modifiable, and regenerated when the port is reactivated.
> It could make sense to detect and warn/abort when a different config exists under the reserved name, requiring the use of `activate -f` ... if that's even possible.

There are some ports that have post-activate and pre-deactivate blocks to run some program to regenerate some global cache. 



More information about the macports-dev mailing list