aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-02-04 17:41:30 (GMT)
committerZac Medico <zmedico@gentoo.org>2011-02-04 17:41:30 (GMT)
commitf90df89f9053bdad96d61935d704f33239f3fed5 (patch)
tree09f827f590549ba11f07d6f28fc02b84489746d5
parentebuild(1): skip REQUIRED_USE for some phases (diff)
downloadportage-f90df89f9053bdad96d61935d704f33239f3fed5.zip
portage-f90df89f9053bdad96d61935d704f33239f3fed5.tar.gz
portage-f90df89f9053bdad96d61935d704f33239f3fed5.tar.bz2
depgraph: make downgrades trigger complete graph
It's common for downgrades to break dependencies, as in bug #353613, so automatically trigger complete graph mode when a downgrade is found.
-rw-r--r--pym/_emerge/depgraph.py23
1 files changed, 21 insertions, 2 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 4334a33..f131889 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3456,8 +3456,27 @@ class depgraph(object):
return 1
if "complete" not in self._dynamic_config.myparams:
- # Skip this to avoid consuming enough time to disturb users.
- return 1
+ # Automatically enable complete mode if there are any
+ # downgrades, since they often break dependencies
+ # (like in bug #353613).
+ have_downgrade = False
+ for node in self._dynamic_config.digraph:
+ if not isinstance(node, Package) or \
+ node.operation != "merge":
+ continue
+ vardb = self._frozen_config.roots[
+ node.root].trees["vartree"].dbapi
+ inst_pkg = vardb.match_pkgs(node.slot_atom)
+ if inst_pkg and inst_pkg[0] > node:
+ have_downgrade = True
+ break
+
+ if have_downgrade:
+ self._dynamic_config.myparams["complete"] = True
+ else:
+ # Skip complete graph mode, in order to avoid consuming
+ # enough time to disturb users.
+ return 1
self._load_vdb()