浏览代码

dpkg: fix trigger setup code to not reset the status of unconfigured packages

The change in commit a36cadba41b19d5908bdfcb658cf01af07c1436a was wrongly
assuming that all packages would be in one of the states
triggers-awaited, triggers-pending or installed when
trig_transitional_activate kicks in.

That is not the case and the status reset should hence only be done when
the current status is already such that the trigger information are
meaningful. transitional_interest_callback_ro() is already taking care
to not add anything in the Triggers-Pending field when the status
is such that it would not make sense.

Reported-by: Hector Oron <hector.oron@gmail.com>
Raphaël Hertzog 15 年之前
父节点
当前提交
667bae316a
共有 2 个文件被更改,包括 5 次插入0 次删除
  1. 3 0
      debian/changelog
  2. 2 0
      src/trigproc.c

+ 3 - 0
debian/changelog

@@ -10,6 +10,9 @@ dpkg (1.16.1.1) UNRELEASED; urgency=low
   * Stop outputting build flags in dpkg-buildpackage as it confuses
     maintainers who are overriding them in debian/rules and who
     are not seeing the expected value in the build log.
+  * Fix trigger setup code to not reset the status of packages
+    when they are in a status different from triggers-awaited,
+    triggers-pending or installed. Closes: #644492
 
   [ Guillem Jover ]
   * Change dpkg-buildflags to set preprocessor option -D_FORTIFY_SOURCE=2

+ 2 - 0
src/trigproc.c

@@ -393,6 +393,8 @@ trig_transitional_activate(enum modstatdb_rw cstatus)
 		 * be written down. This should never happen in theory but
 		 * can happen if you restore an old status file that is
 		 * not in sync with the infodb files. */
+		if (pkg->status < stat_triggersawaited)
+			continue;
 		pkg->status = pkg->trigaw.head ? stat_triggersawaited :
 		              pkg->trigpend_head ? stat_triggerspending :
 		              stat_installed;