summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2019-05-13 03:36:03 +0200
committerGuillem Jover <guillem@debian.org>2019-06-03 03:23:57 +0200
commitb5c50b3c6f0739f45aaa03afa3e5c857e7895c8c (patch)
treea954d152949841aab6ee6a3b5566efef973cda62
parent66223cb9ee839f4fe9c661fbb8818fae9833cf8d (diff)
downloaddpkg-b5c50b3c6f0739f45aaa03afa3e5c857e7895c8c.tar.gz
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
-rw-r--r--debian/changelog3
-rw-r--r--src/main.h13
-rw-r--r--src/trigproc.c8
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..3418c7bcc 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 dependencies.
+ *
+ * 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);