Comment 6 for bug 197968

Revision history for this message
Martin Pitt (pitti) wrote :

Thanks, Flavio. This needs some improvements, though:

 - "rm -f $PACKAGE /etc/udev/rules.d/libmtp7.rules" should disappear; looks like some kind of copy&paste error
 - rm_conffile is not the right semantics here, since the conffile moved to /etc/udev/rules.d/ instead of disappearing entirely. Please look at how /var/lib/dpkg/info/udev.{preinst,postinst,postrm} handles mv_conffile, that is a good reference recipe.
 - The dpkg --compare-versions comparison needs to be fixed: you want to do the transition for every previous version before the one that fixes the bug, but not at all if the package was installed from scratch ($2 is empty): thus, "le 0.2.6.1-1" -> "lt-nl 0.2.6.1-2ubuntu1".

Please test the upgrade with an unmodified and a modified conffile, and also verify that an installation from scratch works as expected. Thank you!

P.S. I'm subscribed to the bug now, so I'll reply to your followups without much delay.