all_match = False
break
- if to_be_selected >= to_be_masked:
- # We only care about the parent atoms
- # when they trigger a downgrade.
- parent_atoms = set()
-
fallback_data.append((to_be_masked, parent_atoms))
if all_match:
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)
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:
self.assertEqual(test_case.test_success, True, test_case.fail_msg)
finally:
playground.cleanup()
+
+
+ def testBacktrackNoWrongRebuilds(self):
+ """
+ Ensure we remove backtrack masks if the reason for the mask gets masked itself.
+ """
+
+ ebuilds = {
+ "dev-libs/A-1": { },
+ "dev-libs/A-2": { },
+ "dev-libs/B-1": { "RDEPEND": "dev-libs/D"},
+ "dev-libs/C-1": { },
+ "dev-libs/C-2": { "RDEPEND": ">=dev-libs/A-2" },
+ "dev-libs/D-1": { "RDEPEND": "<dev-libs/A-2" },
+ }
+
+ installed = {
+ "dev-libs/A-1": { },
+ "dev-libs/B-1": { "RDEPEND": "dev-libs/D" },
+ "dev-libs/C-1": { },
+ "dev-libs/D-1": { "RDEPEND": "<dev-libs/A-2" },
+ }
+
+ world = [ "dev-libs/B", "dev-libs/C" ]
+
+ options = {'--update' : True, '--deep' : True, '--selective' : True}
+
+ test_cases = (
+ ResolverPlaygroundTestCase(
+ ["@world"],
+ options = options,
+ mergelist = [],
+ success = True),
+ )
+
+ playground = ResolverPlayground(ebuilds=ebuilds, installed=installed, world=world)
+
+ try:
+ for test_case in test_cases:
+ playground.run_TestCase(test_case)
+ self.assertEqual(test_case.test_success, True, test_case.fail_msg)
+ finally:
+ playground.cleanup()