From b292f854388956e36e5ba4c2afe084ac98c11346 Mon Sep 17 00:00:00 2001 From: Raphael Hertzog Date: Sun, 11 May 2008 16:41:23 +0200 Subject: [PATCH] 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. --- ChangeLog | 9 +++++++++ debian/changelog | 2 ++ src/processarc.c | 8 +++++--- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 878cce47..d0c92f4c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-05-11 Raphael Hertzog + + * 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 * scripts/Dpkg/Source/Package/V2.pm, diff --git a/debian/changelog b/debian/changelog index d4fe9305..b332cde7 100644 --- a/debian/changelog +++ b/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. diff --git a/src/processarc.c b/src/processarc.c index 1096e1ab..3085962e 100644 --- a/src/processarc.c +++ b/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)) -- 2.39.5