Changes between Version 9 and Version 10 of PortfileRecipes


Ignore:
Timestamp:
Jul 14, 2009, 2:41:43 AM (15 years ago)
Author:
blb@…
Comment:

Add entry about config file handling

Legend:

Unmodified
Added
Removed
Modified
  • PortfileRecipes

    v9 v10  
    112112}}}
    113113See for example the [browser:trunk/dports/lang/sicp/Portfile sicp Portfile].
     114
     115== Proper handling for a port's config files == #configfiles
     116Many ports install config files (usually in ${prefix}/etc) which the user is expected to edit as needed, after the port is installed.  Until ticket #2365 is implemented, proper handling of these config files must be done for each port.  If you simply install the config file as part of the port itself, it will then be deleted on uninstall, as well as overwritten on upgrade.  These outcomes are bad since it loses what the user updated.
     117
     118The current solution is to rename any config files to append a ''.dist'' or ''.sample'' extension to them so that the proper name of the config file is not part of the port.  Then, in a post-activate phase, the port can test for the file's existence and, if it doesn't exist yet, copy it (copied in post-activate directly in ${prefix} keeps the file from being recorded as part of the port).
     119
     120The [browser:trunk/dports/net/squid/Portfile squid Portfile] and [browser:trunk/dports/security/stegdetect/Portfile stegdetect Portfile] are good examples.