Hi!

On Fri, 2019-05-10 at 21:45:09 +0200, Andreas Beckmann wrote:
> On 2019-05-09 06:00, Guillem Jover wrote:
> > awaiting trigger does not help matters, I'm not entirely sure this
> > might not be still a problem with dpkg itself. :/
> 
> I can also reproduce the problem in stretch -> sid upgrades, so in case
> you need to fix dpkg I can verify that before it migrates to testing.

Thanks for the detailed log! Ok, I think I've got a patch now, and it
still passes the functional test suite. Would it be possible and easy
to test that with the failing piuparts runs? Otherwise I'll try to
setup some chroot somewhere to do that.

I'm attaching the patch. Otherwise already built (and signed) binary
packages can be temporarily found at:

  <https://people.debian.org/~guillem/dpkg-triggers/>

Thanks,
Guillem
From a333d52e9f7f99951a89b2b61a5f6807d6fb678c Mon Sep 17 00:00:00 2001
From: Guillem Jover <guil...@debian.org>
Date: Mon, 13 May 2019 03:36:03 +0200
Subject: [PATCH] dpkg: Introduce a new dependency try level for trigger cycle
 checks

This new dependtry level will also check trigger cycles on trigger
process deferral due to unsatisfiable dependencies.

Closes: #928429
---
 debian/changelog |  3 +++
 src/main.h       | 13 +++++++++----
 src/trigproc.c   |  8 +++++---
 3 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 3d97a0111..2a0615f36 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,9 @@ dpkg (1.19.7) UNRELEASED; urgency=medium
   * dpkg: Set the force defaults before loading the config file, otherwise we
     incorrectly override them. Regression introduced in dpkg 1.19.5.
     Closes: #928671
+  * dpkg: Split the trigger dependtry into two, the second of which will be
+    the one checking trigger cycles when deferring trigger processing due to
+    unsatisfiable dependencies. Closes: #928429
 
   [ Updated programs translations ]
   * Catalan (Guillem Jover).
diff --git a/src/main.h b/src/main.h
index e4a251969..7f341303e 100644
--- a/src/main.h
+++ b/src/main.h
@@ -234,18 +234,23 @@ void deferred_configure(struct pkginfo *pkg);
  *   Start processing triggers if necessary.
  *   Do as for try 2.
  *
- * Try 4 (only if --force-depends-version):
+ * Try 4:
+ *   Same as for try 3, but check trigger cycles even when deferring
+ *   processing due to unsatisfiable depedencies.
+ *
+ * Try 5 (only if --force-depends-version):
  *   Same as for try 2, but don't mind version number in dependencies.
  *
- * Try 5 (only if --force-depends):
+ * Try 6 (only if --force-depends):
  *   Do anyway.
  */
 enum dependtry {
 	DEPEND_TRY_NORMAL = 1,
 	DEPEND_TRY_CYCLES = 2,
 	DEPEND_TRY_TRIGGERS = 3,
-	DEPEND_TRY_FORCE_DEPENDS_VERSION = 4,
-	DEPEND_TRY_FORCE_DEPENDS = 5,
+	DEPEND_TRY_TRIGGERS_CYCLES = 4,
+	DEPEND_TRY_FORCE_DEPENDS_VERSION = 5,
+	DEPEND_TRY_FORCE_DEPENDS = 6,
 	DEPEND_TRY_LAST,
 };
 
diff --git a/src/trigproc.c b/src/trigproc.c
index 59e30d143..54b15bbe1 100644
--- a/src/trigproc.c
+++ b/src/trigproc.c
@@ -407,9 +407,11 @@ trigproc(struct pkginfo *pkg, enum trigproc_type type)
 
 		ok = dependencies_ok(pkg, NULL, &depwhynot);
 		if (ok == DEP_CHECK_DEFER) {
-			gaveup = check_trigger_cycle(pkg);
-			if (gaveup == pkg)
-				return;
+			if (dependtry >= DEPEND_TRY_TRIGGERS_CYCLES) {
+				gaveup = check_trigger_cycle(pkg);
+				if (gaveup == pkg)
+					return;
+			}
 
 			varbuf_destroy(&depwhynot);
 			enqueue_package(pkg);
-- 
2.21.0.1020.gf2820cf01a

Reply via email to