aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2020-01-25 17:44:14 -0800
committerZac Medico <zmedico@gentoo.org>2020-01-26 19:18:02 -0800
commitf7d83d75c6b05a16ef07473917082dbd0cd9955c (patch)
treee97c7d91e8cc7321222bf90e19edd8d9d88d260f /lib/_emerge
parentOrChoicesTestCase: split out bug 480736 libpostproc test case (diff)
downloadportage-f7d83d75c6b05a16ef07473917082dbd0cd9955c.tar.gz
portage-f7d83d75c6b05a16ef07473917082dbd0cd9955c.tar.bz2
portage-f7d83d75c6b05a16ef07473917082dbd0cd9955c.zip
dep_zapdeps: adjust || preference for slot upgrades (bug 706278)
Prefer choices that include a slot upgrade when appropriate, like for the || ( llvm:10 ... llvm:7 ) case reported in bug 706278. In order to avoid pulling in inappropriate slot upgrades, like those which should only be pulled in with --update and --deep, add a want_update flag to each choice which is True for choices that pull in a new slot for which an update is desirable. Mark the test case for bug 480736 as todo, since the "undesirable" slot upgrade which triggers a blocker conflict in this test case is practically indistinguishable from a desirable slot upgrade. This particular blocker conflict is no longer relevant, since current versions of media-libs/libpostproc are no longer compatible with any available media-video/ffmpeg slot. In order to solve this test case, some fancy backtracking (like for bug 382421) will be required. Bug: https://bugs.gentoo.org/706278 Bug: https://bugs.gentoo.org/480736 Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'lib/_emerge')
-rw-r--r--lib/_emerge/depgraph.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py
index bf8882774..cae1c4470 100644
--- a/lib/_emerge/depgraph.py
+++ b/lib/_emerge/depgraph.py
@@ -95,6 +95,14 @@ if sys.hexversion >= 0x3000000:
else:
_unicode = unicode
+# Exposes a depgraph interface to dep_check.
+_dep_check_graph_interface = collections.namedtuple('_dep_check_graph_interface',(
+ # Indicates a removal action, like depclean or prune.
+ 'removal_action',
+ # Checks if update is desirable for a given package.
+ 'want_update_pkg',
+))
+
class _scheduler_graph_config(object):
def __init__(self, trees, pkg_cache, graph, mergelist):
self.trees = trees
@@ -510,6 +518,10 @@ class _dynamic_depgraph_config(object):
soname_deps=depgraph._frozen_config.soname_deps_enabled)
# Track missed updates caused by solved conflicts.
self._conflict_missed_update = collections.defaultdict(dict)
+ dep_check_iface = _dep_check_graph_interface(
+ removal_action="remove" in myparams,
+ want_update_pkg=depgraph._want_update_pkg,
+ )
for myroot in depgraph._frozen_config.trees:
self.sets[myroot] = _depgraph_sets()
@@ -530,7 +542,7 @@ class _dynamic_depgraph_config(object):
self._graph_trees[myroot]["vartree"] = graph_tree
self._graph_trees[myroot]["graph_db"] = graph_tree.dbapi
self._graph_trees[myroot]["graph"] = self.digraph
- self._graph_trees[myroot]["want_update_pkg"] = depgraph._want_update_pkg
+ self._graph_trees[myroot]["graph_interface"] = dep_check_iface
self._graph_trees[myroot]["downgrade_probe"] = depgraph._downgrade_probe
def filtered_tree():
pass
@@ -558,7 +570,7 @@ class _dynamic_depgraph_config(object):
self._filtered_trees[myroot]["graph"] = self.digraph
self._filtered_trees[myroot]["vartree"] = \
depgraph._frozen_config.trees[myroot]["vartree"]
- self._filtered_trees[myroot]["want_update_pkg"] = depgraph._want_update_pkg
+ self._filtered_trees[myroot]["graph_interface"] = dep_check_iface
self._filtered_trees[myroot]["downgrade_probe"] = depgraph._downgrade_probe
dbs = []