The following commit has been merged in the master branch:
commit 0085bfd1959622b98083b9d128c007f3e157d500
Author: Michael Vogt <[email protected]>
Date:   Wed Apr 14 13:19:25 2010 +0200

    dpkg: Report deferred trigger errors on status-fd
    
    Report these errors directly through status-fd, instead of reporting
    later on errors which are a consequence of those first errors, which
    can be pretty confusing for a front-end.
    
    Closes: #574599
    
    Signed-off-by: Guillem Jover <[email protected]>

diff --git a/debian/changelog b/debian/changelog
index fe488dd..682c29b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -33,6 +33,10 @@ dpkg (1.15.6.2) UNRELEASED; urgency=low
     file objects. A typo meant that the former never triggered rename
     deferral. Closes: #577756
 
+  [ Guillem Jover ]
+  * Report deferred trigger errors on status-fd. Closes: #574599
+    Thanks to Michael Vogt <[email protected]>.
+
   [ Updated dpkg translations ]
   * German (Sven Joachim).
 
diff --git a/src/trigproc.c b/src/trigproc.c
index 698e14b..74d4cff 100644
--- a/src/trigproc.c
+++ b/src/trigproc.c
@@ -103,6 +103,8 @@ trigproc_enqueue_deferred(struct pkginfo *pend)
 void
 trigproc_run_deferred(void)
 {
+       jmp_buf ejbuf;
+
        debug(dbg_triggers, "trigproc_run_deferred");
        while (!pkg_queue_is_empty(&deferred)) {
                struct pkginfo *pkg;
@@ -111,8 +113,17 @@ trigproc_run_deferred(void)
                if (!pkg)
                        continue;
 
+               if (setjmp(ejbuf)) {
+                       error_unwind(ehflag_bombout);
+                       continue;
+               }
+               push_error_handler(&ejbuf, print_error_perpackage, pkg->name);
+
                pkg->clientdata->trigprocdeferred = NULL;
                trigproc(pkg);
+
+               set_error_display(NULL, NULL);
+               error_unwind(ehflag_normaltidy);
        }
 }
 

-- 
dpkg's main repository


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

Reply via email to