#416706 - dpkg fails to clean up the maintainer scripts from the previous package http://bugs.debian.org./416706
This bug seems to be resolved by sid dpkg, though I was unable to find any related changelog entry. p1 and p2 are some packages with prerm scripts. The hope is to find how p2 installation ends up running a lingering prerm script from p1 (bug). p1-2 is a new version of p1 which doesn't include a prerm. q1 is a package which will conflict+replace p1. PRERM_STATUS determines the exit status of prerm from p1 (only). To test: for a in p1-1 p1-2 p2 q1; do dpkg-deb -b $a; done sudo env PRERM_STATUS=0 dpkg -P p1 p2 q1 sudo env PRERM_STATUS=0 dpkg -i p1-1.deb sudo env PRERM_STATUS=1 dpkg -i p1-2.deb q1.deb p2.deb This causes the p1 prerm to be run 3 times. Once while upgrading from p1-1 to p1-2, and once each while installing q1 and p2. The latter 2 cases are erroneous since the wrong initscript is run. The "Conflicts+Replaces" seems to be necessary since upgrading from p1-1 to p1-2 and simultaneously installing p2 causes the p1 prerm to fail (as intended) but now p2 installs successfully. I just checked that the nonextance of the p1-2 prerm really is important. Upgrading from etch dpkg to sid resolves the problem.
dpkg-416706.tar
Description: Unix tar archive

