The following commit has been merged in the master branch:
commit f8d3fee967ab657aa84418150526eddebb0423c2
Author: Guillem Jover <[email protected]>
Date:   Sun Apr 7 02:30:30 2013 +0200

    dpkg: Always reset want status when removing or purging a package
    
    Move pkg_set_want() and modstatdb_note() calls from deferred_remove()
    to the beginning of the function so that it affects all remove/purge
    requests, even if it ends up getting ignored so that we can properly
    update the wanted status.
    
    Do not try to set the want status for packages with want_unknown.
    
    Closes: #163763

diff --git a/debian/changelog b/debian/changelog
index 91b6446..d7fd292 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -60,6 +60,8 @@ dpkg (1.17.0) UNRELEASED; urgency=low
     current one and the specific maintainer script filename, and if it's
     not different to the current one, use "dpkg_script_t" as a fallback.
   * Do not unnecessarily create a dpkg update log record on remove or purge.
+  * Always reset want status when removing or purging a package; so this
+    now resets holds among others. Closes: #163763
 
  -- Guillem Jover <[email protected]>  Fri, 03 Aug 2012 13:21:00 +0200
 
diff --git a/src/remove.c b/src/remove.c
index 6ae39ad..06d2c95 100644
--- a/src/remove.c
+++ b/src/remove.c
@@ -90,6 +90,16 @@ void deferred_remove(struct pkginfo *pkg) {
   debug(dbg_general, "deferred_remove package %s",
         pkg_name(pkg, pnaw_always));
 
+  if (!f_pending && pkg->want != want_unknown) {
+    if (cipaction->arg_int == act_purge)
+      pkg_set_want(pkg, want_purge);
+    else
+      pkg_set_want(pkg, want_deinstall);
+
+    if (!f_noact)
+      modstatdb_note(pkg);
+  }
+
   if (pkg->status == stat_notinstalled) {
     warning(_("ignoring request to remove %.250s which isn't installed"),
             pkg_name(pkg, pnaw_nonambig));
@@ -109,16 +119,6 @@ void deferred_remove(struct pkginfo *pkg) {
     forcibleerr(fc_removeessential, _("This is an essential package -"
                 " it should not be removed."));
 
-  if (!f_pending) {
-    if (cipaction->arg_int == act_purge)
-      pkg_set_want(pkg, want_purge);
-    else
-      pkg_set_want(pkg, want_deinstall);
-
-    if (!f_noact)
-      modstatdb_note(pkg);
-  }
-
   debug(dbg_general, "checking dependencies for remove '%s'",
         pkg_name(pkg, pnaw_always));
   rok= 2;

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to