The following commit has been merged in the master branch:
commit 65ade6390b47fe3ec6a0e2ba341f3d553bf4bbc6
Author: Guillem Jover <[email protected]>
Date:   Sat Jul 28 03:30:50 2012 +0200

    dpkg: Activate file triggers on removal more accurately
    
    Activate them only when we know we are inevitably removing things.

diff --git a/debian/changelog b/debian/changelog
index 6ded7a5..cc86220 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -66,6 +66,8 @@ dpkg (1.17.0) UNRELEASED; urgency=low
     holds among others. Closes: #162541
   * Defer cleanup of .dpkg-new and .dpkg-tmp paths on removal to the point
     when we are definitely removing the main path.
+  * Activate file triggers on removal more accurately, only when we know
+    we are inevitably removing things.
 
  -- Guillem Jover <[email protected]>  Fri, 03 Aug 2012 13:21:00 +0200
 
diff --git a/src/remove.c b/src/remove.c
index 4267705..a8dea95 100644
--- a/src/remove.c
+++ b/src/remove.c
@@ -283,8 +283,6 @@ removal_bulk_remove_files(struct pkginfo *pkg)
         continue;
       }
 
-      trig_file_activate(usenode, pkg);
-
       if (is_dir) {
         debug(dbg_eachfiledetail, "removal_bulk is a directory");
         /* Only delete a directory or a link to one if we're the only
@@ -302,6 +300,8 @@ removal_bulk_remove_files(struct pkginfo *pkg)
           continue;
       }
 
+      trig_file_activate(usenode, pkg);
+
       varbuf_trunc(&fnvb, before);
       varbuf_add_str(&fnvb, DPKGTEMPEXT);
       varbuf_end_str(&fnvb);
@@ -389,7 +389,6 @@ static void removal_bulk_remove_leftover_dirs(struct 
pkginfo *pkg) {
     }
 
     usenode = namenodetouse(namenode, pkg, &pkg->installed);
-    trig_file_activate(usenode, pkg);
 
     varbuf_reset(&fnvb);
     varbuf_add_str(&fnvb, instdir);
@@ -409,6 +408,8 @@ static void removal_bulk_remove_leftover_dirs(struct 
pkginfo *pkg) {
         continue;
     }
 
+    trig_file_activate(usenode, pkg);
+
     debug(dbg_eachfiledetail, "removal_bulk removing '%s'", fnvb.buf);
     if (!rmdir(fnvb.buf) || errno == ENOENT || errno == ELOOP) continue;
     if (errno == ENOTEMPTY || errno == EEXIST) {

-- 
dpkg's main repository


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

Reply via email to