From: Colin Watson Date: Thu, 29 May 2008 03:53:34 +0000 (+0300) Subject: Add a few more comment around obscure bits of trigger handling code X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=354cf7ad828818aa4cef17e801c06e697a8c0616;p=dpkg Add a few more comment around obscure bits of trigger handling code --- 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);