commit: f049604664bff616b297a5c022b6a8277542eac9 Author: Zac Medico <zmedico <AT> gentoo <DOT> org> AuthorDate: Sat Apr 11 23:45:33 2020 +0000 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> CommitDate: Sat Apr 11 23:50:21 2020 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=f0496046
Add test case to reproduce bug 717140 Bug: https://bugs.gentoo.org/717140 Signed-off-by: Zac Medico <zmedico <AT> gentoo.org> .../resolver/test_slot_operator_reverse_deps.py | 94 +++++++++++++++++++++- 1 file changed, 93 insertions(+), 1 deletion(-) diff --git a/lib/portage/tests/resolver/test_slot_operator_reverse_deps.py b/lib/portage/tests/resolver/test_slot_operator_reverse_deps.py index ce614a4dc..5c5295510 100644 --- a/lib/portage/tests/resolver/test_slot_operator_reverse_deps.py +++ b/lib/portage/tests/resolver/test_slot_operator_reverse_deps.py @@ -1,4 +1,4 @@ -# Copyright 2016 Gentoo Foundation +# Copyright 2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 from portage.tests import TestCase @@ -111,3 +111,95 @@ class SlotOperatorReverseDepsTestCase(TestCase): test_case.fail_msg) finally: playground.cleanup() + + +class SlotOperatorReverseDepsLibGit2TestCase(TestCase): + + def testSlotOperatorReverseDepsLibGit2(self): + """ + Test bug #717140, where the depgraph _slot_operator_update_probe + method ignored <dev-libs/libgit2-1:0= dependency and tried to + trigger an upgrade to dev-libs/libgit2-1.0.0-r1, ultimately + resulting in an undesirable downgrade to dev-libs/libgit2-0.28.4-r1. + """ + self.todo = True + + ebuilds = { + + "dev-libs/libgit2-0.28.4-r1" : { + "EAPI": "7", + "SLOT": "0/28", + }, + + "dev-libs/libgit2-0.99.0-r1" : { + "EAPI": "7", + "SLOT": "0/0.99", + }, + + "dev-libs/libgit2-1.0.0-r1" : { + "EAPI": "7", + "SLOT": "0/1.0", + }, + + "dev-libs/libgit2-glib-0.28.0.1" : { + "EAPI": "7", + "SLOT": "0", + "RDEPEND": "<dev-libs/libgit2-0.29:0= >=dev-libs/libgit2-0.26.0", + }, + + "dev-libs/libgit2-glib-0.99.0.1" : { + "EAPI": "7", + "SLOT": "0", + "RDEPEND": "<dev-libs/libgit2-1:0= >=dev-libs/libgit2-0.26.0", + }, + + "dev-vcs/gitg-3.32.1-r1" : { + "EAPI": "7", + "SLOT": "0", + "RDEPEND": "dev-libs/libgit2:= >=dev-libs/libgit2-glib-0.27 <dev-libs/libgit2-glib-1", + }, + } + + installed = { + + "dev-libs/libgit2-0.99.0-r1" : { + "EAPI": "7", + "SLOT": "0/0.99", + }, + + "dev-libs/libgit2-glib-0.99.0.1" : { + "EAPI": "7", + "SLOT": "0", + "RDEPEND": "<dev-libs/libgit2-1:0/0.99= >=dev-libs/libgit2-0.26.0", + }, + + "dev-vcs/gitg-3.32.1-r1" : { + "EAPI": "7", + "SLOT": "0", + "RDEPEND": "dev-libs/libgit2:0/0.99= >=dev-libs/libgit2-glib-0.27 <dev-libs/libgit2-glib-1", + }, + + } + + world = ["dev-vcs/gitg"] + + test_cases = ( + ResolverPlaygroundTestCase( + ["@world"], + options = {"--update": True, "--deep": True}, + success = True, + #mergelist = ['dev-libs/libgit2-0.28.4-r1', 'dev-libs/libgit2-glib-0.99.0.1', 'dev-vcs/gitg-3.32.1-r1'], + mergelist = [], + ), + ) + + playground = ResolverPlayground(ebuilds=ebuilds, + installed=installed, world=world, debug=False) + 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.debug = False + playground.cleanup()