[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#574443: debhelper: New helper proposal: dh_oldconffiles (or similar name)



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: