The following commit has been merged in the master branch:
commit 3a960ffff2b8ff08d924e5e4fcba8fec640b43be
Author: Guillem Jover <[EMAIL PROTECTED]>
Date:   Thu Jul 10 09:12:11 2008 +0300

    Do not leave new conffile as .dpkg-new when it has been diverted
    
    Also properly activate the file trigger for the diverted conffile.
    Based on a patch by Timothy G Abbott. Closes: #58735, #476899

diff --git a/ChangeLog b/ChangeLog
index 4ddf962..5eeb626 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-07-10  Guillem Jover  <[EMAIL PROTECTED]>,
+            Timothy G Abbott  <[EMAIL PROTECTED]>
+
+       * src/configure.c (deferred_configure): Call namenodetouse to handle
+       diverted conffiles. Use trig_file_activate on usenode, instead of
+       trig_file_activate_byname, to activate the correct file trigger for
+       the diverted conffile.
+
 2008-07-06  Guillem Jover  <[EMAIL PROTECTED]>
 
        * src/main.h: Remove comment about side effect in namenodetouse.
diff --git a/debian/changelog b/debian/changelog
index 63f3d52..7b807bc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -28,6 +28,9 @@ dpkg (1.15.0) UNRELEASED; urgency=low
   * Print a longer string when a disallowed field value is found when parsing.
   * Use $(filter ...) instead of $(findstring ...) to extract space separated
     options from DEB_BUILD_OPTIONS in debian/rules.
+  * Do not leave new conffile as .dpkg-new when it has been diverted, also
+    properly activate the file trigger for the diverted conffile.
+    Based on a patch by Timothy G Abbott. Closes: #58735, #476899
 
   [ Raphael Hertzog ]
   * Enhance dpkg-shlibdeps's error message when a library can't be found to
diff --git a/src/configure.c b/src/configure.c
index 5bf60d5..0924020 100644
--- a/src/configure.c
+++ b/src/configure.c
@@ -171,7 +171,12 @@ void deferred_configure(struct pkginfo *pkg) {
                 * processed this one.
                 */
                for (conff= pkg->installed.conffiles; conff; conff= 
conff->next) {
-                       r= conffderef(pkg, &cdr, conff->name);
+                       struct filenamenode *usenode;
+
+                       usenode = namenodetouse(findnamenode(conff->name,
+                                                            fnn_nocopy), pkg);
+
+                       r = conffderef(pkg, &cdr, usenode->name);
                        if (r == -1) {
                                conff->hash= EMPTY_HASH;
                                continue;
@@ -207,7 +212,8 @@ void deferred_configure(struct pkginfo *pkg) {
                                what= cfo_identical;
                        } else if (!strcmp(currenthash,NONEXISTENTFLAG) && 
fc_conff_miss) {
                                fprintf(stderr, _("\nConfiguration file `%s', 
does not exist on system.\n"
-                                                       "Installing new config 
file as you request.\n"), conff->name);
+                                                 "Installing new config file 
as you request.\n"),
+                                       usenode->name);
                                what= cfo_newconff;
                                useredited= -1;
                                distedited= -1;
@@ -231,9 +237,11 @@ void deferred_configure(struct pkginfo *pkg) {
 
                        debug(dbg_conff,
                                        "deferred_configure `%s' (= `%s') 
useredited=%d distedited=%d what=%o",
-                                       conff->name, cdr.buf, useredited, 
distedited, what);
+                             usenode->name, cdr.buf, useredited, distedited,
+                             what);
 
-                       what=promptconfaction(conff->name, cdr.buf, cdr2.buf, 
useredited, distedited, what);
+                       what = promptconfaction(usenode->name, cdr.buf, 
cdr2.buf,
+                                               useredited, distedited, what);
 
                        switch (what & ~(cfof_isnew|cfof_userrmd)) {
                                case cfo_keep | cfof_backup:
@@ -246,7 +254,7 @@ void deferred_configure(struct pkginfo *pkg) {
                                        varbufaddstr(&cdr,DPKGDISTEXT);
                                        varbufaddc(&cdr,0);
                                        strcpy(cdr2rest,DPKGNEWEXT);
-                                       trig_file_activate_byname(conff->name, 
pkg);
+                                       trig_file_activate(usenode, pkg);
                                        if (rename(cdr2.buf,cdr.buf))
                                                fprintf(stderr,
                                                                _("dpkg: %s: 
warning - failed to rename `%.250s' to `%.250s': %s\n"),
@@ -279,10 +287,11 @@ void deferred_configure(struct pkginfo *pkg) {
                                                                pkg->name, 
cdr.buf, cdr2.buf, strerror(errno));
                                        /* fall through */
                                case cfo_install:
-                                       printf(_("Installing new version of 
config file %s ...\n"),conff->name);
+                                       printf(_("Installing new version of 
config file %s ...\n"),
+                                              usenode->name);
                                case cfo_newconff:
                                        strcpy(cdr2rest,DPKGNEWEXT);
-                                       trig_file_activate_byname(conff->name, 
pkg);
+                                       trig_file_activate(usenode, pkg);
                                        if (rename(cdr2.buf,cdr.buf))
                                                ohshite(_("unable to install 
`%.250s' as `%.250s'"),cdr2.buf,cdr.buf);
                                        break;

-- 
dpkg's main repository


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

Reply via email to