port updates
Joshua Root
jmr at macports.org
Fri Feb 27 03:53:25 PST 2009
Scott Haneda wrote:
> Can I get some guidance on port updates? Here would be an example case:
>
> port install:
> /opt/local/var/ASSP
> /opt/local/var/ASSP/assp.pl
> /opt/local/var/ASSP/files/a.txt
> /opt/local/var/ASSP/files/b.txt
> /opt/local/var/ASSP/files/c.txt
>
> Those are the files installed on a new instalation.
>
> If new version comes up, I will update the portfile. However, only
> /opt/local/var/ASSP/assp.pl
> will need to be replaced, the rest are equal to user config files.
>
> Would I just build my inital port file to do something like:
> if (! file_exists('/opt/local/var/ASSP/files/a.txt')) {
> // xinstall the file
> }
>
> That way, when an update comes along, it leaves those files alone? These
> files would still be registered with ports, so an uninstall would remove
> them?
>
> Is the general idea that an uninstall removes everything, or do I want
> to somehow preserve those files on uninstall as well?
The usual practice is to install sample config files only, and tell the
user to copy them to create the real config file, or do so automatically
in post-activate only if they don't already exist. See the squid port
for an example of the latter.
- Josh
More information about the macports-users
mailing list