Neil asks about removing debconf old values when replacing a package with a different one.
Usually, you shouldn't need to worry about this; when the old package is finally purged all its debconf values will be cleaned up. In case that doesn't happen for some reason, you do not need to include the templates in the new package in order to get them removed. Actually, due to debconf's reference counting, that shouldn't work anyway.
What you need is debconf-communicate(1). Specifically, something like this in a maintainer script of the new package, before it sources debconf's confmodule:
echo purge | debconf-communicate oldpackage
(Updated: Fixed incorrect syntax!)
Meh, databases add such complexity.. If I were redesigning debconf today, it would use flat files on disk and those files would be removed by dpkg on purge.
Thanks for answering, Joey - but I get errors. command_purge in ConfModule.pm doesn't allow any arguments: return $codes{syntaxerror}, "Incorrect number of arguments" if @_ > 0; So it appears debconf doesn't support purging without an implicit package/templates file? Incidentally, I found OpenId opened the door to a lot of spammers - it was one of the reasons why my blog no longer has comments enabled.
If that one line is adjusted (I used @_ > 4 ) it works with: echo purge emsetup/primary | debconf-communicate emdebian-tools
I've corrected the syntax in my example above. The PURGE command removes all questions owned by the package.
Why not rewrite debconf today? I wrote it to solve a problem, which it still solves. Don't have infinite time.