[Reproducible-commits] [dpkg] 41/74: dpkg: Activate file triggers for conffiles on purge

Mattia Rizzolo mattia at debian.org
Sun Jul 3 22:22:55 UTC 2016


This is an automated email from the git hooks/post-receive script.

mattia pushed a commit to annotated tag 1.18.8
in repository dpkg.

commit 2f065fc151ac4635ae40bd769d1be810e1222e05
Author: Guillem Jover <guillem at debian.org>
Date:   Sun May 22 02:42:00 2016 +0200

    dpkg: Activate file triggers for conffiles on purge
    
    The code has never activated triggers for conffiles on purge, the code
    before commit 65ade6390b47fe3ec6a0e2ba341f3d553bf4 was activating them
    on removal, which was obviously wrong.
    
    Stable-Candidate: 1.17.x
    Reported-by: Helmut Grohne <helmut at subdivi.de>
---
 debian/changelog | 3 +++
 src/remove.c     | 7 +++++++
 2 files changed, 10 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 176138b..2fe7b43 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -22,6 +22,9 @@ dpkg (1.18.8) UNRELEASED; urgency=medium
     Thanks to Niall Walsh <niallwalsh at celtux.org>. Closes: #824542
   * Set primary group to 0 in dpkg when running as root.
     Reported by Stuart Prescott <stuart at debian.org>.
+  * Activate file triggers for conffiles on purge, which has never happened
+    before. Before dpkg 1.17.0, conffiles were triggered on removal, which
+    was obviously wrong. Reported by Helmut Grohne <helmut at subdivi.de>.
   * Perl modules:
     - Use warnings::warnif() instead of carp() for deprecated warnings.
     - Add new format_range() method and deprecate dpkg() and rfc822() methods
diff --git a/src/remove.c b/src/remove.c
index b5cb996..d164546 100644
--- a/src/remove.c
+++ b/src/remove.c
@@ -514,6 +514,7 @@ static void removal_bulk_remove_configfiles(struct pkginfo *pkg) {
     modstatdb_note(pkg);
 
     for (conff= pkg->installed.conffiles; conff; conff= conff->next) {
+      struct filenamenode *namenode, *usenode;
     static struct varbuf fnvb, removevb;
       struct varbuf_state removevb_state;
 
@@ -527,6 +528,12 @@ static void removal_bulk_remove_configfiles(struct pkginfo *pkg) {
             conff->name, rc == -1 ? "<rc == -1>" : fnvb.buf);
       if (rc == -1)
         continue;
+
+      namenode = findnamenode(fnvb.buf, fnn_nonew);
+      usenode = namenodetouse(namenode, pkg, &pkg->installed);
+
+      trig_path_activate(usenode, pkg);
+
       conffnameused = fnvb.used;
       if (unlink(fnvb.buf) && errno != ENOENT && errno != ENOTDIR)
         ohshite(_("cannot remove old config file '%.250s' (= '%.250s')"),

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list