ソースを参照

dpkg: Activate file triggers on disappearance more accurately

Activate them only when we know we are inevitably removing things.
Guillem Jover 13 年 前
コミット
010c35a493
共有2 個のファイルを変更した6 個の追加1 個の削除を含む
  1. 2 0
      debian/changelog
  2. 4 1
      src/unpack.c

+ 2 - 0
debian/changelog

@@ -35,6 +35,8 @@ dpkg (1.17.2) UNRELEASED; urgency=low
     reset the loop detector and avoid the assert. Closes: #143307
   * Activate all path components for file triggers on removal.
     Regression introduced in 1.17.0. Closes: #725437
+  * Activate file triggers on disappearance more accurately, only when we know
+    we are inevitably removing things.
 
   [ Updated programs translations ]
   * German (Sven Joachim).

+ 4 - 1
src/unpack.c

@@ -975,7 +975,6 @@ void process_archive(const char *filename) {
       continue;
 
     usenode = namenodetouse(namenode, pkg, &pkg->installed);
-    trig_file_activate(usenode, pkg);
 
     varbuf_trunc(&fnamevb, fnameidlu);
     varbuf_add_str(&fnamevb, usenode->name);
@@ -995,6 +994,8 @@ void process_archive(const char *filename) {
       continue;
     }
     if (S_ISDIR(oldfs.st_mode)) {
+      trig_path_activate(usenode, pkg);
+
       if (rmdir(fnamevb.buf)) {
 	warning(_("unable to delete old directory '%.250s': %s"),
 	        namenode->name, strerror(errno));
@@ -1095,6 +1096,8 @@ void process_archive(const char *filename) {
       if (sameas)
 	continue;
 
+      trig_path_activate(usenode, pkg);
+
       if (secure_unlink_statted(fnamevb.buf, &oldfs)) {
         warning(_("unable to securely remove old file '%.250s': %s"),
                 namenode->name, strerror(errno));