Re: Bug#574443: debhelper: New helper proposal: dh_oldconffiles (or similar name)
- To: debian-dpkg@lists.debian.org
- Subject: Re: Bug#574443: debhelper: New helper proposal: dh_oldconffiles (or similar name)
- From: Jean-Christophe Dubacq <jcdubacq1@free.fr>
- Date: Thu, 01 Apr 2010 09:05:51 +0200
- Message-id: <4BB445CF.7090007@free.fr>
- In-reply-to: <20100331203750.GC2515@gnu.kitenet.net>
- References: <20100318095641.24254.24038.reportbug@Tamino> <20100331203750.GC2515@gnu.kitenet.net>
On 31/03/2010 22:37, Joey Hess wrote:
> Didier Raboud wrote:
>> while updating one of my packages (which again dropped a conffile), I had to
>> modify its preinst, according to http://wiki.debian.org/DpkgConffileHandling .
>>
>> This works but is IMHO suboptimal: the code referenced on the wiki has to be
>> hand copied in each and every package that has to move or delete conffiles.
>>
>> This could maybe be done through a dh_oldconffiles (for removing) and a
>> dh_moveconffiles (for moving). Those helpers would read ${package}.oldconffiles
>> in debian/ containing e.g.:
>
> I prefer to keep large blocks of code out of maintainer scripts
> entirely, by putting them in utilities that debhelper can then arrange
> maintainer scripts to call. Or that maintainers can call directly.
>
> So, I wrote a patch to dpkg in 2008 to add a dpkg-conffile command,
> that handles renaming and removal of conffiles.
>
> http://lists.debian.org/debian-dpkg/2008/01/msg00143.html
>
> There was a little bit of followup, but dpkg's maintainers never
> integrated it, nor do they seem to have given a reason not to integrate it.
>
> The patch still seems good. From the history of
> http://wiki.debian.org/DpkgConffileHandling , I see only one bugfix has
> been made to that page since, that should be folded into the patch. It is
> described here: http://lists.debian.org/debian-devel/2008/03/msg00795.html
There is also the fact that the code on this page does not deal with the
abort-upgrade condition. Code doing that (for moving conffile)
should also test for abort-upgrade in prerm and put back in place the
conffile; for deleting conffile, the conffile should not be deleted too
soon (but moved away and deleted in the postinst/postrm).
--
Jean-Christophe Dubacq
Reply to: