ソースを参照

Add a few more comment around obscure bits of trigger handling code

Colin Watson 18 年 前
コミット
354cf7ad82
共有3 個のファイルを変更した12 個の追加0 個の削除を含む
  1. 6 0
      ChangeLog
  2. 3 0
      lib/dbmodify.c
  3. 3 0
      src/trigproc.c

+ 6 - 0
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  <cjwatson@debian.org>
+
+	* 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  <cjwatson@debian.org>
 
 	* lib/triglib.c (trig_incorporate): Fix typo in comment.

+ 3 - 0
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;

+ 3 - 0
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);