On 2016-07-27 22:25, Daniel Pocock wrote: >> So what you are trying to do is to >> a) rename a conffile and > > They are copied, not renamed
> The original conffiles remain associated with the freeradius-client > package and when nothing else on the system depends on freeradius-client > any more, those conffiles can be removed with it. > >> b) change its ownership to a different package >> at the same time. That is unfortunately not well supported by the >> current tools (e.g. dpkg-maintscript-helper). > The radcli package keeps its conffiles in /etc/radcli Well, the "effective" conffile (which the admin should edit) changes its name (and owning package). This looks like you would want this: preinst: if this is a new install and $oldconffile exists and $oldconffile has been modified locally (i.e. does not match the checksum recorded by dpkg) then place a copy of it as $newconffile.migrated fi postinst: if $newconffile.migrated exists then mv $newconffile $newconffile.dpkg-new mv $newconffile.migrated $newconffile echo "migrated $oldconffile to $newconffile" fi whatever-mainterner-script-handles-abort-install: remove $newconffile.migrated This will avoid the conffile prompt if $oldconffile was pristine (by not migrating it) and in the other cases this will effectively postpone the conffile prompt to the next upgrade of $newpkg which comes with a different version of $newconffile. This would behave similarly to dpkg-maintscript-helper mv_conffile. Andreas