Retro-actively adjust port's deinstall operations?
Chris Rees
crees at FreeBSD.org
Sun Jun 10 20:38:53 UTC 2012
On 10 June 2012 21:18, Adam Strohl <adams-freebsd at ateamsystems.com> wrote:
> Hello,
>
> I've just submitted a PR to update the CouchDB port from 1.1.0 to 1.2.0:
> http://www.freebsd.org/cgi/query-pr.cgi?pr=168923
>
> Background: CouchDB's local.ini file stores all overridden options and
> default.ini the defaults, similar to /etc/rc.conf & /etc/defaults/rc.conf.
>
> While updating the port I discovered that the existing port lists local.ini
> directly in pkg-plist instead of installing a local.ini.sample file and
> doing proper comparisons/tests for changes. So it blindly removes this file
> on deinstall.
>
> If my diff in the above PR is accepted when people uninstall the existing
> 1.1.0 port it will remove their config file. The new port will see that
> there is no local.ini and copy in the sample for them but this is really
> awful for obvious reasons.
>
> Is there a way to reach people with a warning about this _before_ they
> uninstall/reinstall so they can back up the file before upgrading?
>
> Or is /usr/ports/UPDATING it? (and do I need to do anything special to have
> this listed there?)
I'm sorry, you're rather stuffed there. The same happened with a port
I took over a while ago.
Actually if the older version doesn't install a .sample file (as it
doesn't), you could put a big warning in for it:
.include <bsd.port.pre.mk>
.if exists(${PREFIX}/whateverconfigfile) &&
!exists(${PREFIX}/whateverconfigfile.sample)
IGNORE= Please see UPDATING note {date}
.endif
Stick a note in UPDATING (perhaps like 20110815), and send a HEADSUP to ports@:
BEFORE you deinstall couchdb, make sure you take a backup of
default.ini, because the port will clobber it.
I've grabbed your PR and will investigate tomorrow.
Chris
More information about the freebsd-ports
mailing list