Overwriting config files

Anders F Björklund afb at macports.org
Fri Aug 17 04:25:44 PDT 2007


Ryan Schmidt wrote:

>> The ticket mentions the need to have install/uninstall scripts (i.e. 
>> not do it in activate/deactivate since that only works with images), 
>> and that functionality is needed in order for the *.sample approach 
>> to be useful. It's another old ticket, though: 
>> http://trac.macports.org/projects/macports/ticket/1068
>
> I don't see how #1068 is related to Brian's request. Don't see why 
> install/uninstall scripts are necessary for anything.

Necessary and necessary... They are a convenience for users, so that 
you don't have to do anything extra in order to use the default 
configuration ?

Maybe this concrete configuration example from FreeBSD's Ports helps: 
http://www.freebsd.org/doc/en/books/porters-handbook/plist-config.html

>> For the configuration files, it would be a great benefit to the 
>> packaging targets if there was a way to specify which ones are 
>> conffiles. Probably something like "destroot.conffiles", similar to 
>> the existing "destroot.keepdirs". This would signify that the files 
>> in question are *not* to be overwritten...
>
> Don't see why that's necessary. I think we're doing just fine with 
> individual portfiles installing their sample conf files with *.sample 
> or *.default names.

It is great when not installing (port install), such as when using the 
binary packages...

For instance both RPM and DEB have built-in facilities for handling 
configs when upgrading.

>> So all these Tickets are related (#777 is another one), and the 
>> implementation of these missing features should be taken to the 
>> macports-dev list. So to me, it seems that at least two new pieces of 
>> functionality are needed to be added to the MacPorts base in order to 
>> support this ?
>
> #777 seems to be a "nice to have" rather than a requirement:
>
> http://trac.macports.org/projects/macports/ticket/777
>
> "If a port installs a foo.cf.sample it might want to copy 
> foo.cf.sample to foo.cf iff foo.cf doesn't exist. This is probably 
> common enough that the port author shouldn't be forced to write an 
> on-install foo.cf.sample [ ! -f foo.cf ] && cp foo.cf.sample foo.cf"
>
> I don't understand what functionality requested by Brian cannot be met 
> by MacPorts 1.5.2 as it is today.

It's an enhancement alright, but I think that it would fit in great 
with the need of packages to signify which files are configuration ? In 
essence doing "port install/uninstall" and binary archives/packages 
have different needs, but I think it would be great to have features 
for both of them. And I do prefer simply listing the conffiles, rather 
than having to write any such install/uninstall scripts manually.

--anders




More information about the macports-users mailing list