diff options
-rw-r--r-- | pym/_emerge/depgraph.py | 8 | ||||
-rw-r--r-- | pym/portage/tests/resolver/test_autounmask.py | 48 | ||||
-rw-r--r-- | pym/portage/tests/resolver/test_slot_collisions.py | 20 |
3 files changed, 61 insertions, 15 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index fbd16ad98..429d8871c 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -3009,6 +3009,10 @@ class depgraph(object): {"myparent" : dep.parent, "show_req_use" : pkg})) self._dynamic_config._required_use_unsatisfied = True self._dynamic_config._skip_restart = True + # Add pkg to digraph in order to enable autounmask messages + # for this package, which is useful when autounmask USE + # changes have violated REQUIRED_USE. + self._dynamic_config.digraph.add(pkg, dep.parent, priority=priority) return 0 if not pkg.onlydeps: @@ -9428,10 +9432,6 @@ class depgraph(object): return self._dynamic_config._need_config_reload def autounmask_breakage_detected(self): - # Check for REQUIRED_USE violations. - for changes in self._dynamic_config._needed_use_config_changes.values(): - if getattr(changes, 'required_use_satisfied', None) is False: - return True try: for pargs, kwargs in self._dynamic_config._unsatisfied_deps_for_display: self._show_unsatisfied_dep( diff --git a/pym/portage/tests/resolver/test_autounmask.py b/pym/portage/tests/resolver/test_autounmask.py index 9042349ea..809d42104 100644 --- a/pym/portage/tests/resolver/test_autounmask.py +++ b/pym/portage/tests/resolver/test_autounmask.py @@ -251,15 +251,42 @@ class AutounmaskTestCase(TestCase): use_changes={ "dev-util/R-1": { "bar": True } }), #Test interaction with REQUIRED_USE. + # Some of these cases trigger USE change(s) that violate + # REQUIRED_USE, so the USE changes are shown along with + # the REQUIRED_USE violation that they would trigger. + + # The following USE changes are necessary to proceed: + # (see "package.use" in the portage(5) man page for more details) + # # required by app-portage/A-1::test_repo + # # required by =app-portage/A-1 (argument) + # >=app-portage/B-1 foo + # + # !!! The ebuild selected to satisfy "app-portage/B[foo]" has unmet requirements. + # - app-portage/B-1::test_repo USE="bar (forced-flag) -foo" + # + # The following REQUIRED_USE flag constraints are unsatisfied: + # exactly-one-of ( foo bar ) ResolverPlaygroundTestCase( ["=app-portage/A-1"], options={ "--autounmask": True }, - use_changes=None, + use_changes={"app-portage/B-1": {"foo": True}}, success=False), + + # The following USE changes are necessary to proceed: + # (see "package.use" in the portage(5) man page for more details) + # # required by app-portage/A-2::test_repo + # # required by =app-portage/A-2 (argument) + # >=app-portage/B-1 foo + # + # !!! The ebuild selected to satisfy "app-portage/B[foo=]" has unmet requirements. + # - app-portage/B-1::test_repo USE="bar (forced-flag) -foo" + # + # The following REQUIRED_USE flag constraints are unsatisfied: + # exactly-one-of ( foo bar ) ResolverPlaygroundTestCase( ["=app-portage/A-2"], options={ "--autounmask": True }, - use_changes=None, + use_changes={"app-portage/B-1": {"foo": True}}, success=False), ResolverPlaygroundTestCase( ["=app-portage/C-1"], @@ -269,10 +296,25 @@ class AutounmaskTestCase(TestCase): # Test bug 622462, where it inappropriately unmasked a newer # version rather than report unsatisfied REQUIRED_USE. + # + # The following USE changes are necessary to proceed: + # (see "package.use" in the portage(5) man page for more details) + # # required by sci-mathematics/octave-4.2.2::test_repo + # # required by sci-mathematics/octave (argument) + # >=x11-libs/qscintilla-2.9.4 qt5 + # + # !!! The ebuild selected to satisfy ">=x11-libs/qscintilla-2.9.3-r2:=[qt5(+)]" has unmet requirements. + # - x11-libs/qscintilla-2.9.4::test_repo USE="qt4 -qt5" + # + # The following REQUIRED_USE flag constraints are unsatisfied: + # exactly-one-of ( qt4 qt5 ) + # + # (dependency required by "sci-mathematics/octave-4.2.2::test_repo" [ebuild]) + # (dependency required by "sci-mathematics/octave" [argument]) ResolverPlaygroundTestCase( ["sci-mathematics/octave"], options={"--autounmask": True}, - use_changes=None, + use_changes={"x11-libs/qscintilla-2.9.4": {"qt5": True}}, success=False), #Make sure we don't change masked/forced flags. diff --git a/pym/portage/tests/resolver/test_slot_collisions.py b/pym/portage/tests/resolver/test_slot_collisions.py index 9fcd5294a..430ccaad6 100644 --- a/pym/portage/tests/resolver/test_slot_collisions.py +++ b/pym/portage/tests/resolver/test_slot_collisions.py @@ -136,15 +136,19 @@ class SlotCollisionTestCase(TestCase): slot_collision_solutions = [{"sci-libs/Q-1": {"foo": True}, "sci-libs/P-1": {"foo": True}}] ), - #Conflict with REQUIRED_USE - ResolverPlaygroundTestCase( - ["=app-misc/C-1", "=app-misc/B-1"], - all_permutations = True, - slot_collision_solutions = [], - mergelist = ["app-misc/A-1", "app-misc/C-1", "app-misc/B-1"], - ignore_mergelist_order = True, - success = False), ) + # NOTE: For this test case, ResolverPlaygroundTestCase attributes + # vary randomly between runs, so it's expected to fail randomly. + #Conflict with REQUIRED_USE + #ResolverPlaygroundTestCase( + # ["=app-misc/C-1", "=app-misc/B-1"], + # all_permutations = True, + # slot_collision_solutions = None, + # use_changes={"app-misc/A-1": {"foo": True}}, + # mergelist = ["app-misc/A-1", "app-misc/C-1", "app-misc/B-1"], + # ignore_mergelist_order = True, + # success = False), + #) playground = ResolverPlayground(ebuilds=ebuilds, installed=installed) try: |