backtracking: adjust || preference to break dependency cycles

Store dependency cycle edges as backtracking parameters, and use them
to adjust || preferences in order to break dependency cycles. This
extends direct cycle breaking to handle indirect dependency cycles,
which solves the cmake-bootstrap test case for bug 703440. If any
cycle(s) remain unsolved by the next backtracking run, then backtracking
aborts and the cycle(s) are reported as usual.

Note that backtracking is necessary in order to avoid bugs of the form
"emerge installs packages only to have them removed by depclean", since
this sort of behavior is desirable only when it eliminates a dependency
cycle.

Bug: https://bugs.gentoo.org/382421
Bug: https://bugs.gentoo.org/384107
Bug: https://bugs.gentoo.org/703440
Signed-off-by: Zac Medico <zmedico@gentoo.org>
4 files changed