summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2019-01-21 12:58:34 +0100
committerGuillem Jover <guillem@debian.org>2019-01-22 04:11:13 +0100
commita23fdc82c44011d2aa54138df4c4af37bd4d5e9e (patch)
tree94ca20b5c1e882546c142aa31abc383e59193f06
parentb166c999d28cc56e5befe7f13329ec5aa8f448ca (diff)
downloaddpkg-a23fdc82c44011d2aa54138df4c4af37bd4d5e9e.tar.gz
dpkg: Split trigger processing types into required, try-queued and try-deferred
Each of these reasons for processing triggers have different requirements and attributes: - The required one, must perform all checks as it is done as part of a simple loop to guarantee Pre-Depends satisfiability. - The try-deferred one, must not fail on unsatisfiable dependencies, as we are doing opportunistic trigger processing, after a normal processing queue run. - The try-queued one, must perform all checks and fail hard if any unsatisfiable scenario occurs.
-rw-r--r--debian/changelog2
-rw-r--r--src/main.h6
-rw-r--r--src/trigproc.c4
3 files changed, 8 insertions, 4 deletions
diff --git a/debian/changelog b/debian/changelog
index 409195f0e..a37ad29a2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -94,6 +94,8 @@ dpkg (1.19.3) UNRELEASED; urgency=medium
- dpkg: Switch dependtry from an int to an enum.
- dpkg: Move dependtry description from deferred_configure() to its
declaration.
+ - dpkg: Split trigger processing types into required, try-queued and
+ try-deferred.
* Build system:
- get-version: Use a format string with printf.
- run-script: Use $() instead of deprecated ``.
diff --git a/src/main.h b/src/main.h
index e43e6d28d..c60ccfab0 100644
--- a/src/main.h
+++ b/src/main.h
@@ -318,8 +318,10 @@ void dpkg_selabel_close(void);
/* from trigproc.c */
enum trigproc_type {
- /** Opportunistic trigger processing. */
- TRIGPROC_TRY,
+ /** Opportunistic deferred trigger processing. */
+ TRIGPROC_TRY_DEFERRED,
+ /** Opportunistic queued trigger processing. */
+ TRIGPROC_TRY_QUEUED,
/** Required trigger processing. */
TRIGPROC_REQUIRED,
};
diff --git a/src/trigproc.c b/src/trigproc.c
index 76d901176..5b7066d8a 100644
--- a/src/trigproc.c
+++ b/src/trigproc.c
@@ -162,7 +162,7 @@ trigproc_run_deferred(void)
ensure_package_clientdata(pkg);
pkg->clientdata->trigprocdeferred = NULL;
- trigproc(pkg, TRIGPROC_TRY);
+ trigproc(pkg, TRIGPROC_TRY_DEFERRED);
pop_error_context(ehflag_normaltidy);
}
@@ -416,7 +416,7 @@ trigproc(struct pkginfo *pkg, enum trigproc_type type)
* requires us to be able to make progress; skip the
* package and silently ignore the error due to
* unsatisfiable dependencies. */
- if (type == TRIGPROC_TRY) {
+ if (type == TRIGPROC_TRY_DEFERRED) {
varbuf_destroy(&depwhynot);
return;
}