+2007-09-14 Brian M. Carlson <sandals@crustytoothpaste.ath.cx>
+
+ * src/remove.c (deferred_remove): Store the previous package status
+ when calling '<prerm> remove' and pass it to push_cleanup.
+ * src/cleanup.c (cu_prermremove): Restore previous stored status if
+ the '<postinst> abort-remove' call succeeds.
+
2007-09-08 Guillem Jover <guillem@debian.org>
* scripts/dpkg-buildpackage.sh: Use fakeroot, if present, as default
dpkg-buildpackage.
* Fix typos in dpkg-deb.1 and start-stop-daemon.8. Closes: #441051
Thanks to A. Costa.
+ * After '<prerm> remove' fails and while doing the error unwinding, if
+ the '<postinst> abort-remove' call succeeds, preserve the old status
+ instead of unconditionally setting it to 'Installed'. Closes: #432893
+ Thanks to Brian M. Carlson.
[ Updated dpkg translations ]
* Portuguese (Miguel Figueiredo). Closes: #441113
void cu_prermremove(int argc, void **argv) {
struct pkginfo *pkg= (struct pkginfo*)argv[0];
+ enum pkgstatus *oldpkgstatus= (enum pkgstatus*)argv[1];
if (cleanup_pkg_failed++) return;
maintainer_script_installed(pkg,POSTINSTFILE,"post-installation",
"abort-remove", NULL);
- pkg->status= stat_installed;
+ pkg->status= *oldpkgstatus;
pkg->eflag &= ~eflagf_reinstreq;
modstatdb_note(pkg);
cleanup_pkg_failed--;
if (pkg->status == stat_halfconfigured || pkg->status == stat_installed) {
if (pkg->status == stat_installed || pkg->status == stat_halfconfigured) {
+ static enum pkgstatus oldpkgstatus;
+
+ oldpkgstatus= pkg->status;
pkg->status= stat_halfconfigured;
modstatdb_note(pkg);
- push_cleanup(cu_prermremove,~ehflag_normaltidy, 0,0, 1,(void*)pkg);
+ push_cleanup(cu_prermremove, ~ehflag_normaltidy, 0, 0, 2,
+ (void *)pkg, (void *)&oldpkgstatus);
maintainer_script_installed(pkg, PRERMFILE, "pre-removal",
"remove", NULL);
}