From 354cf7ad828818aa4cef17e801c06e697a8c0616 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Thu, 29 May 2008 06:53:34 +0300 Subject: [PATCH] Add a few more comment around obscure bits of trigger handling code --- ChangeLog | 6 ++++++ lib/dbmodify.c | 3 +++ src/trigproc.c | 3 +++ 3 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index 112b5bfe..fd9fd9a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -138,6 +138,12 @@ dpkg is unable to create a file so that it also refers to the real filename instead of the non-diverted name only. +2008-05-29 Colin Watson + + * lib/dbmodify.c (modstatdb_note): Add a comment around obscure bits + of trigger handling code. + * src/trigproc.c (trigproc): Likewise. + 2008-05-29 Colin Watson * lib/triglib.c (trig_incorporate): Fix typo in comment. diff --git a/lib/dbmodify.c b/lib/dbmodify.c index 1eacd5a6..cdaa1624 100644 --- a/lib/dbmodify.c +++ b/lib/dbmodify.c @@ -251,6 +251,9 @@ void modstatdb_note(struct pkginfo *pkg) { onerr_abort++; + /* Clear pending triggers here so that only code that sets the status + * to interesting (for triggers) values has to care about triggers. + */ if (pkg->status != stat_triggerspending && pkg->status != stat_triggersawaited) pkg->trigpend_head = NULL; diff --git a/src/trigproc.c b/src/trigproc.c index b327f5d3..32a6ed52 100644 --- a/src/trigproc.c +++ b/src/trigproc.c @@ -295,6 +295,9 @@ trigproc(struct pkginfo *pkg) } varbufaddc(&namesarg, 0); + /* Setting the status to halfconfigured + * causes modstatdb_note to clear pending triggers. + */ pkg->status = stat_halfconfigured; modstatdb_note(pkg); -- 2.39.5