diff options
author | Guillem Jover <guillem@debian.org> | 2014-11-13 12:10:42 +0100 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2014-11-22 18:52:16 +0100 |
commit | 9a9ba74915876449b1fe20d4b76ab759f7d09d86 (patch) | |
tree | 9bb6ec2ce2c1a69fa2f0cfc10f07a41495212fef /src/trigproc.c | |
parent | c4e109999d90e99199754e3e419ef90477b2a046 (diff) | |
download | dpkg-9a9ba74915876449b1fe20d4b76ab759f7d09d86.tar.gz |
dpkg: Fail on trigger processing when it is required to progress
Trigger processing is sometimes required and sometimes opportunistic.
When trying to make progress on the packages queue, we need to consider
it an error if the dependencies cannot be satisfied in this run. But if
we are running the deferred trigger processing, then we should not fail,
as that's just opportunistic.
Closes: #768852
Diffstat (limited to 'src/trigproc.c')
-rw-r--r-- | src/trigproc.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/trigproc.c b/src/trigproc.c index 965e5c597..4d61d7054 100644 --- a/src/trigproc.c +++ b/src/trigproc.c @@ -124,7 +124,7 @@ trigproc_run_deferred(void) pkg_name(pkg, pnaw_nonambig)); pkg->clientdata->trigprocdeferred = NULL; - trigproc(pkg); + trigproc(pkg, TRIGPROC_TRY); pop_error_context(ehflag_normaltidy); } @@ -312,7 +312,7 @@ check_trigger_cycle(struct pkginfo *processing_now) * that case does nothing but fix up any stale awaiters. */ void -trigproc(struct pkginfo *pkg) +trigproc(struct pkginfo *pkg, enum trigproc_type type) { static struct varbuf namesarg; @@ -347,8 +347,22 @@ trigproc(struct pkginfo *pkg) enqueue_package(pkg); return; } else if (ok == DEP_CHECK_HALT) { + /* When doing opportunistic trigger processig, nothing + * requires us to be able to make progress; skip the + * package and silently ignore the error due to + * unsatisfiable dependencies. */ + if (type == TRIGPROC_TRY) { + varbuf_destroy(&depwhynot); + return; + } + + sincenothing = 0; + varbuf_end_str(&depwhynot); + notice(_("dependency problems prevent processing " + "triggers for %s:\n%s"), + pkg_name(pkg, pnaw_nonambig), depwhynot.buf); varbuf_destroy(&depwhynot); - return; + ohshit(_("dependency problems - leaving triggers unprocessed")); } else if (depwhynot.used) { varbuf_end_str(&depwhynot); notice(_("%s: dependency problems, but processing " |