diff options
author | Guillem Jover <guillem@debian.org> | 2014-10-24 15:18:11 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2014-10-25 02:14:16 +0200 |
commit | 317083c11091dcd9e2b1a36677964aaaa0b53c1c (patch) | |
tree | 3fefd144894b202b6ec705765eb375ef92c86160 /src | |
parent | a67c4ccd2d72d01d3c0e5f9a152d685ef8d86a1d (diff) | |
download | dpkg-317083c11091dcd9e2b1a36677964aaaa0b53c1c.tar.gz |
dpkg: Perform trigger cycle detection earlier or later depending on dependtry
Do trigger cycle detection after dependency checks in dependtry <= 1,
and before dependency cycle breaking in dependtry > 1. This makes sure
to always catch trigger cycles, but still gives the opportunity to try
to process triggers for packages that are not yet ready in the first
dependtry, but which might be a bit later on, without wrongly detecting
avoidable and bogus trigger cycles.
Closes: #766557
Diffstat (limited to 'src')
-rw-r--r-- | src/trigproc.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/trigproc.c b/src/trigproc.c index bcecac50b..965e5c597 100644 --- a/src/trigproc.c +++ b/src/trigproc.c @@ -332,9 +332,14 @@ trigproc(struct pkginfo *pkg) assert(pkg->status == PKG_STAT_TRIGGERSPENDING || pkg->status == PKG_STAT_TRIGGERSAWAITED); - if (dependtry > 1) + if (dependtry > 1) { + gaveup = check_trigger_cycle(pkg); + if (gaveup == pkg) + return; + if (findbreakcycle(pkg)) sincenothing = 0; + } ok = dependencies_ok(pkg, NULL, &depwhynot); if (ok == DEP_CHECK_DEFER) { @@ -352,9 +357,11 @@ trigproc(struct pkginfo *pkg) varbuf_destroy(&depwhynot); } - gaveup = check_trigger_cycle(pkg); - if (gaveup == pkg) - return; + if (dependtry <= 1) { + gaveup = check_trigger_cycle(pkg); + if (gaveup == pkg) + return; + } printf(_("Processing triggers for %s (%s) ...\n"), pkg_name(pkg, pnaw_nonambig), |