Parcourir la source

Activate triggers when a file is removed in a shared directory

* src/processarc.c (process_archive): While removing files that
disappeared, move the call to namenodetouse before the test
that skips directory shared with other packages. This is required
because namenodetouse() handles trigger activation and we really
want directories containing (only) removed files to activate the
corresponding triggers.
Raphael Hertzog il y a 18 ans
Parent
commit
b292f85438
3 fichiers modifiés avec 16 ajouts et 3 suppressions
  1. 9 0
      ChangeLog
  2. 2 0
      debian/changelog
  3. 5 3
      src/processarc.c

+ 9 - 0
ChangeLog

@@ -1,3 +1,12 @@
+2008-05-11  Raphael Hertzog  <hertzog@debian.org>
+
+	* src/processarc.c (process_archive): While removing files that
+	disappeared, move the call to namenodetouse before the test
+	that skips directory shared with other packages. This is required
+	because namenodetouse() handles trigger activation and we really
+	want directories containing (only) removed files to activate the
+	corresponding triggers.
+
 2008-05-08  Raphael Hertzog  <hertzog@debian.org>
 
 	* scripts/Dpkg/Source/Package/V2.pm,

+ 2 - 0
debian/changelog

@@ -39,6 +39,8 @@ dpkg (1.14.19) UNRELEASED; urgency=low
   * Change the "2.0" and "3.0 (quilt)" source packages to refuse by default
     binary files in the debian sub-directory. They have to be whitelisted
     through debian/source/include-binaries. Closes: #473041
+  * Make sure triggers are activated when a file is removed in a directory
+    shared by multiple packages. Closes: #479850
   
   [ Helge Kreutzmann ]
   * Minor fixes and clarifications to man pages.

+ 5 - 3
src/processarc.c

@@ -633,14 +633,16 @@ void process_archive(const char *filename) {
     if ((namenode->flags & fnnf_new_conff) ||
         (namenode->flags & fnnf_new_inarchive))
       continue;
+
+    fnamevb.used= fnameidlu;
+    varbufaddstr(&fnamevb, namenodetouse(namenode,pkg)->name);
+    varbufaddc(&fnamevb,0);
+
     if (!stat(namenode->name,&stab) && S_ISDIR(stab.st_mode)) {
       debug(dbg_eachfiledetail, "process_archive: %s is a directory",
 	    namenode->name);
       if (isdirectoryinuse(namenode,pkg)) continue;
     }
-    fnamevb.used= fnameidlu;
-    varbufaddstr(&fnamevb, namenodetouse(namenode,pkg)->name);
-    varbufaddc(&fnamevb,0);
 
     if (lstat(fnamevb.buf, &oldfs)) {
       if (!(errno == ENOENT || errno == ELOOP || errno == ENOTDIR))