The following commit has been merged in the master branch:
commit 6c6ec4a438f889e90f4741fd7780eb6626e933e1
Author: Guillem Jover <[email protected]>
Date:   Sun Jul 12 20:02:56 2009 +0200

    dpkg: Properly mark packages being purged for disappearance
    
    When a package has been purged, it should be marked as want_unknown
    and the configversion blanked, otherwise dpkg considers it to still
    be informative and keeps it around, which needs later on manual
    intervention from the user to clean up the database.

diff --git a/debian/changelog b/debian/changelog
index 91989b5..350b8b1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,9 @@ dpkg (1.15.4) UNRELEASED; urgency=low
     .dsc parsing code. As a side effect it now handles properly bogus files.
   * Do not remap obsolete fields in dpkg-scanpackages as they have been
     handled already by “dpkg-deb -I”.
+  * Properly mark packages being purged for disappearance from the database.
+    This will make the status database not be left behind with traces of old
+    not-installed packages.
 
   [ Raphael Hertzog ]
   * Replace install-info by a wrapper around GNU's install-info. The wrapper
diff --git a/src/processarc.c b/src/processarc.c
index 7b428dd..3703aad 100644
--- a/src/processarc.c
+++ b/src/processarc.c
@@ -1065,9 +1065,10 @@ void process_archive(const char *filename) {
     pop_cleanup(ehflag_normaltidy); /* closedir */
     
     otherpkg->status= stat_notinstalled;
-    otherpkg->want= want_purge;
+    otherpkg->want = want_unknown;
     otherpkg->eflag= eflagv_ok;
 
+    blankversion(&otherpkg->configversion);
     blankpackageperfile(&otherpkg->installed);
 
     otherpkg->clientdata->fileslistvalid= 0;
diff --git a/src/remove.c b/src/remove.c
index 0790dac..086ffe8 100644
--- a/src/remove.c
+++ b/src/remove.c
@@ -549,6 +549,7 @@ void removal_bulk(struct pkginfo *pkg) {
     debug(dbg_general, "removal_bulk no postrm, no conffiles, purging");
     pkg->want= want_purge;
 
+    blankversion(&pkg->configversion);
   } else if (pkg->want == want_purge) {
 
     removal_bulk_remove_configfiles(pkg);
@@ -580,6 +581,7 @@ void removal_bulk(struct pkginfo *pkg) {
     if (unlink(fnvb.buf) && errno != ENOENT) ohshite(_("can't remove old 
postrm script"));
 
     pkg->status= stat_notinstalled;
+    pkg->want = want_unknown;
 
     /* This will mess up reverse links, but if we follow them
      * we won't go back because pkg->status is stat_notinstalled.

-- 
dpkg's main repository


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

Reply via email to