From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id B3BE8138A1F for ; Fri, 19 Sep 2014 09:28:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 38C73E08AB; Fri, 19 Sep 2014 09:28:27 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B321FE08AB for ; Fri, 19 Sep 2014 09:28:26 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7852E3401BA for ; Fri, 19 Sep 2014 09:28:25 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 06CA0E82 for ; Fri, 19 Sep 2014 09:28:24 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1411118775.c81f3f4586b7b6164f5038ac778098911fef9404.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/, pym/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: pym/_emerge/depgraph.py pym/portage/tests/resolver/test_solve_non_slot_operator_slot_conflicts.py X-VCS-Directories: pym/portage/tests/resolver/ pym/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: c81f3f4586b7b6164f5038ac778098911fef9404 X-VCS-Branch: master Date: Fri, 19 Sep 2014 09:28:24 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 55ba5e5c-50c0-436d-abd2-57125738a41a X-Archives-Hash: 7d1276050fc5b23d39babf1f386bdecc commit: c81f3f4586b7b6164f5038ac778098911fef9404 Author: Zac Medico gentoo org> AuthorDate: Fri Sep 19 09:24:58 2014 +0000 Commit: Zac Medico gentoo org> CommitDate: Fri Sep 19 09:26:15 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c81f3f45 _solve_..slot_conflicts: fix bug #522084 Fix _solve_non_slot_operator_slot_conflicts to add all parents to the conflict_graph, even for parents where the atom matches all relevant nodes. Otherwise, we risk removing all of the matched nodes from the graph, which would cause a missed update. X-Gentoo-Bug: 522084 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=522084 Reviewed-by: Alexander Berntsen gentoo.org> --- pym/_emerge/depgraph.py | 14 ++-- .../test_solve_non_slot_operator_slot_conflicts.py | 75 ++++++++++++++++++++++ 2 files changed, 82 insertions(+), 7 deletions(-) diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index e7ae720..f4e5a1b 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -1172,12 +1172,15 @@ class depgraph(object): for match in matched: writemsg_level(" match: %s\n" % match, level=logging.DEBUG, noiselevel=-1) - if len(matched) == len(conflict): - # All packages match. - continue + if len(matched) > 1: + # Even if all packages match, this parent must still + # be added to the conflict_graph. Otherwise, we risk + # removing all of these packages from the depgraph, + # which could cause a missed update (bug #522084). + conflict_graph.add(or_tuple(matched), parent) elif len(matched) == 1: conflict_graph.add(matched[0], parent) - elif len(matched) == 0: + else: # This typically means that autounmask broke a # USE-dep, but it could also be due to the slot # not matching due to multislot (bug #220341). @@ -1189,9 +1192,6 @@ class depgraph(object): for pkg in conflict: writemsg_level(" non-match: %s\n" % pkg, level=logging.DEBUG, noiselevel=-1) - else: - # More than one packages matched, but not all. - conflict_graph.add(or_tuple(matched), parent) for pkg in indirect_conflict_pkgs: for parent, atom in self._dynamic_config._parent_atoms.get(pkg, []): diff --git a/pym/portage/tests/resolver/test_solve_non_slot_operator_slot_conflicts.py b/pym/portage/tests/resolver/test_solve_non_slot_operator_slot_conflicts.py new file mode 100644 index 0000000..c6024f4 --- /dev/null +++ b/pym/portage/tests/resolver/test_solve_non_slot_operator_slot_conflicts.py @@ -0,0 +1,75 @@ +# Copyright 2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +from portage.tests import TestCase +from portage.tests.resolver.ResolverPlayground import (ResolverPlayground, + ResolverPlaygroundTestCase) + +class SolveNonSlotOperatorSlotConflictsTestCase(TestCase): + + def testSolveNonSlotOperatorSlotConflicts(self): + + ebuilds = { + + "app-misc/A-1" : { + "EAPI": "5", + "SLOT": "0/1", + "PDEPEND": "app-misc/B" + }, + + "app-misc/A-2" : { + "EAPI": "5", + "SLOT": "0/2", + "PDEPEND": "app-misc/B" + }, + + "app-misc/B-0" : { + "EAPI": "5", + "RDEPEND": "app-misc/A:=" + }, + + } + + installed = { + + "app-misc/A-1" : { + "EAPI": "5", + "SLOT": "0/1", + "PDEPEND": "app-misc/B" + }, + + "app-misc/B-0" : { + "EAPI": "5", + "RDEPEND": "app-misc/A:0/1=" + }, + + } + + world = ["app-misc/A"] + + test_cases = ( + + # bug 522084 + # In this case, _solve_non_slot_operator_slot_conflicts + # removed both versions of app-misc/A from the graph, since + # they didn't have any non-conflict parents (except for + # @selected which matched both instances). The result was + # a missed update. + ResolverPlaygroundTestCase( + ["@world"], + options = {"--update": True, "--deep": True}, + success = True, + mergelist = ['app-misc/A-2', 'app-misc/B-0'] + ), + + ) + + 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.cleanup()