Re: transitioning config files between two packages
On Thu, Sep 14, 2006 at 09:07:12AM +0200, Frank Küster wrote:
> Maybe I'm dumb, but this code doesn't seem correct to me, in the sense
> that it doesn't do the right thing. Let's consider a couple of possible
> 1. The conffile at the old place (or package) is the same as the one in
> the new place
> In this case the code in the wiki does the right thing.
> 2. At the same time as the move is done, the contents of the file do
> also change. And here "same time" doesn't necessarily mean "same
> upload", it can as well be "same run of dist-upgrade", which often
> skips intermediate versions, especially when upgrading from stable to
> new stable.
> In this case the user should get a conffile prompt during upgrade, to
> be able to consider the changes made in the package. But that won't
> happen with the code in the wiki; instead the old, locally changed
> version will be used unconditionally.
Yes, you're right that this code unconditionally uses the user's version of
the conffile when moving it, instead of allowing the conffile question to
The way to get the conffile prompt for a user-modified file is to move the
old version of the conffile to the new location in the preinst if the old
conffile md5sum doesn't match the current conffile md5sum for the package.
Since the earlier preinst code has already removed any old versions of the
file that are known to be unmodified, this won't give any undesirable
conffile prompts. Then, if dpkg's stored md5sum for the old conffile *does*
match that of the current shipped conffile (which you'll know because you
still have the conffile present in the old location in the postinst), you
would go ahead with this same code in the postinst to move it into place
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.