diff options
author | Sebastian Luther <SebastianLuther@gmx.de> | 2011-09-19 15:07:08 +0200 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-09-20 09:47:34 -0700 |
commit | 6cea2091526659521d35be6c8dc7733f69f1a760 (patch) | |
tree | 3f3e2598d61469ce598b7b89bcf6b60ac0b8e5d9 /pym/_emerge/resolver | |
parent | 72ef29a6adaa053cf2d538349a3a1555909ed697 (diff) | |
download | portage-6cea2091526659521d35be6c8dc7733f69f1a760.tar.gz portage-6cea2091526659521d35be6c8dc7733f69f1a760.tar.bz2 portage-6cea2091526659521d35be6c8dc7733f69f1a760.zip |
Reject inconsistent backtrack parameters
If backtracking masks a package that caused another package to
be masked, we declare this backtracking node as invalid. The
backtracker should be able to find another node that gives a
valid solution if one exists. This fixes bug 375573.
Diffstat (limited to 'pym/_emerge/resolver')
-rw-r--r-- | pym/_emerge/resolver/backtracking.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/pym/_emerge/resolver/backtracking.py b/pym/_emerge/resolver/backtracking.py index dcdaee0cb..e072275fe 100644 --- a/pym/_emerge/resolver/backtracking.py +++ b/pym/_emerge/resolver/backtracking.py @@ -84,6 +84,9 @@ class Backtracker(object): Adds a newly computed backtrack parameter. Makes sure that it doesn't already exist and that we don't backtrack deeper than we are allowed by --backtrack. """ + if not self._check_runtime_pkg_mask(node.parameter.runtime_pkg_mask): + return + if node.mask_steps <= self._max_depth and node not in self._nodes: if explore: self._unexplored_nodes.append(node) @@ -105,6 +108,28 @@ class Backtracker(object): def __len__(self): return len(self._unexplored_nodes) + def _check_runtime_pkg_mask(self, runtime_pkg_mask): + """ + If a package gets masked that caused other packages to be masked + before, we revert the mask for other packages (bug 375573). + """ + + for pkg in runtime_pkg_mask: + + if "missing dependency" in runtime_pkg_mask[pkg]: + continue + + entry_is_valid = False + + for ppkg, patom in runtime_pkg_mask[pkg].get("slot conflict", set()): + if ppkg not in runtime_pkg_mask: + entry_is_valid = True + break + + if not entry_is_valid: + return False + + return True def _feedback_slot_conflict(self, conflict_data): for pkg, parent_atoms in conflict_data: |