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

Bug#335276: transferring ownership of conffile to avoid dpkg prompt; incomplete solution



At least 4 major packages are presently affected by conffile prompts
during upgrades from Sarge to current testing, because the name of the
package owning some conffile changed.  When dpkg queries "what is the
md5sum of the old conffile", it probably looks only for md5sums of
files owned by the old package, and so finds nothing, and the usual
logic doesn't apply.

See also bullet 3 of Bill Allombert's message titled "Some bits of
experience gained from handling upgrade-reports"; this is a similar
situation:
  http://lists.debian.org/debian-devel-announce/2005/06/msg00006.html

Bill's simple recipe is to remove the conffile in preinst if the
md5sum of the conffile matches that of the stable version.
http://dpkg.org/ has an even better example, which plays nicely even
for upgrades from versions not in the stable release; it works by
parsing the dpkg status database with sed (and not distinguising
between which package owns a conffile).

During preinst, status contains the old md5sums, and immediately
before calling postinst configure, new conffiles are put into place,
with a prompt if the current md5sum matches neither the stored value
nor the new value.

At the very least, I would expect no unnecessary conffile prompts on
upgrade from sarge to etch; so, I'm sending this now instead of
waiting for myself or someone else to come up with a more complete
solution.

Check out the minimal packages, conf-owner-transfer and
conf-owner-test, which you can use to help understand what is going
on:
  http://justinpryzby.com/debian/conf-owner-transfer_1.tar.gz

I note that it does not preserve conffile removal, and keybuk notes
that errors are not handled (for example, aborted abgrades).

# Start from a fresh state
sudo dpkg -P conf-owner-{test,transfer}

# Start with a single package "conf-owner-test" which owns the
# conffile /etc/confowner.conf; ignore the presence of the second
# package "conf-owner-transfer".
./debian/rules v1

# Build and install version 1.  Note that "conf-owner-transfer" either
# doesn't exist at version 1, or doesn't own the conffile.
dpkg-buildpackage -rfakeroot
sudo dpkg -i ../conf-owner-test_1_all.deb

# Increase the binary package version, and switch which binary package
# owns the conffile.  For simplity, I don't rename the directory.
./debian/rules v2

# Build and install version 2; note that both packages are installed
# in the same dpkg run.  Note the the conffile has been updated
# without prompting.  Repeat the process, after commenting out the
# "rm" line, and note how much nicer it was to not be prompted.
dpkg-buildpackage -rfakeroot
sudo dpkg -i  ../conf-owner-{test,transfer}_2_all.deb

-- 
Clear skies,
Justin




Reply to: