On Thu, 06 Oct 2011, Hector Oron wrote: > To be able to reproduce: > # multistrap -f armhf.conf -d test-chroot > # cp /usr/bin/qemu-arm-static test-chroot/usr/bin > # chroot test-chroot dpkg --configure -a
Running this with debugging enabled shows me: # dpkg -D71223 --configure -a D020000: trig_transitional_activate libtext-wrapi18n-perl unpacked D020000: trig_transitional_activate debconf unpacked D020000: trig_transitional_activate dash unpacked D020000: trig_transitional_activate coreutils unpacked D020000: trig_transitional_activate sudo unpacked D020000: trig_transitional_activate debianutils unpacked D020000: trig_transitional_activate login unpacked D020000: trig_transitional_activate gpgv unpacked D020000: trig_transitional_activate libssl1.0.0 unpacked D020000: trig_transitional_activate libgdbm3 unpacked [...] D010000: trigproc_run_deferred # The status change is the result of commit a36cadba41b19d5908bdfcb658cf01af07c1436a The problem only manifests itself on initial installation since that code is executed only when /var/lib/dpkg/triggers/Unincorp doesn't exist yet. (So an easy work-around for now is to mkdir /var/lib/dpkg/triggers && touch /var/lib/dpkg/triggers/Unincorp in the created chroot) I am attaching the patch that I will shortly commit to the sid branch. Cheers, -- Raphaël Hertzog ◈ Debian Developer Pre-order a copy of the Debian Administrator's Handbook and help liberate it: http://debian-handbook.info/go/ulule-rh/
commit 667bae316a302c0f62e5e38a6c791a62785af4b2 Author: Raphaël Hertzog <[email protected]> Date: Thu Oct 6 15:32:36 2011 +0200 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 <[email protected]> diff --git a/debian/changelog b/debian/changelog index 6554462..cd32353 100644 --- a/debian/changelog +++ b/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 diff --git a/src/trigproc.c b/src/trigproc.c index 862740b..154a2f3 100644 --- a/src/trigproc.c +++ b/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;

