(Switching from bug 143307 to 487637)
On Thu, 03 Jul 2008, Raphael Hertzog wrote:
> On Thu, 03 Jul 2008, Raphael Hertzog wrote:
> > > Package: a
> > > Triggers-Awaited: b
> > >
> > > Package: b
> > > Status: ... installed
> >
> > So it's exactly the same situation as in #487637, #489068. Looks like both
> > are correlated after all.
>
> But I confirm that the patch doesn't fix those bugs. Supplementary changes
> are needed in packages() to add the package in triggerawaited status to
> the process queue. But deferred_configure() probably also needs to be
> changed.
I tried to come up with a patch, see below. The nicest solution I found
was to detect packages in triggerawaited status if we were asked to
configure them, and to add to the process queue the packages that are
providing the triggers (those listed in pkg->trigaw.head->pend). The
changes you made, let process_queue() call trigproc() which will call
trig_clear_awaiters() and resolve the situation.
There are two problems where I'd welcome your input:
- if we have an explicit list of packages to configure, I'm not respecting
--force-configure-any and will blindly add the packages providing the
triggers to the queue
- there's no feedback to the user that something has been done, it just
silently fixes the status of the packages, I'm not sure where that
feedback could/should be added.
I tested the patch here and it successfully resolves the situation
above with dpkg --configure -a.
diff --git a/src/packages.c b/src/packages.c
index 25395c4..ef72e96 100644
--- a/src/packages.c
+++ b/src/packages.c
@@ -108,6 +108,16 @@ void packages(const char *const *argv) {
while ((pkg = iterpkgnext(it)) != NULL) {
switch (cipaction->arg) {
case act_configure:
+ if (pkg->status == stat_triggersawaited) {
+ /* The only way to configure packages in this status is by
+ * processing the trigger of the corresponding package */
+ struct trigaw *ta = pkg->trigaw.head;
+ while(ta) {
+ add_to_queue(ta->pend);
+ ta = ta->sameaw.next;
+ }
+ continue;
+ }
if (!(pkg->status == stat_unpacked ||
pkg->status == stat_halfconfigured ||
pkg->trigpend_head))
@@ -150,6 +160,18 @@ void packages(const char *const *argv) {
badusage(_("you must specify packages by their own names,"
" not by quoting the names of the files they come in"));
}
+ if ((cipaction->arg == act_configure) &&
+ (pkg->status == stat_triggersawaited)) {
+ /* The only way to configure packages in this status is by
+ * processing the trigger of the corresponding package */
+ /* TODO: shall we respect --force-configure-any here ? */
+ struct trigaw *ta = pkg->trigaw.head;
+ while(ta) {
+ add_to_queue(ta->pend);
+ ta = ta->sameaw.next;
+ }
+ continue;
+ }
add_to_queue(pkg);
}
--
Raphaël Hertzog
Le best-seller français mis à jour pour Debian Etch :
http://www.ouaza.com/livre/admin-debian/
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]