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 E99D9138247 for ; Tue, 7 Jan 2014 22:22:47 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E9F13E09AE; Tue, 7 Jan 2014 22:22:44 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 6B566E09AE for ; Tue, 7 Jan 2014 22:22:44 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5A58533F6B6 for ; Tue, 7 Jan 2014 22:22:43 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 9DFAAE54AB for ; Tue, 7 Jan 2014 22:22:41 +0000 (UTC) From: "Arfrever Frehtes Taifersar Arahesis" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Arfrever Frehtes Taifersar Arahesis" Message-ID: <1389133300.ecf817d1b1913ddff65fb020c6bc5558d550d2bd.arfrever@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_slot_conflict_rebuild.py X-VCS-Directories: pym/portage/tests/resolver/ pym/_emerge/ X-VCS-Committer: arfrever X-VCS-Committer-Name: Arfrever Frehtes Taifersar Arahesis X-VCS-Revision: ecf817d1b1913ddff65fb020c6bc5558d550d2bd X-VCS-Branch: master Date: Tue, 7 Jan 2014 22:22:41 +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: d664c861-46b0-41f8-8d03-726d8b74f704 X-Archives-Hash: 6049024cd3cf693f77a859d72eee4152 commit: ecf817d1b1913ddff65fb020c6bc5558d550d2bd Author: Sebastian Luther gmx de> AuthorDate: Tue Jan 7 22:21:40 2014 +0000 Commit: Arfrever Frehtes Taifersar Arahesis Apache Org> CommitDate: Tue Jan 7 22:21:40 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ecf817d1 Bug #497238: Fix unnecessary rebuild caused by equal versions in different repositories. --- pym/_emerge/depgraph.py | 4 +- .../tests/resolver/test_slot_conflict_rebuild.py | 44 +++++++++++++++++++++- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 763f3fd..83035c2 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -1,4 +1,4 @@ -# Copyright 1999-2013 Gentoo Foundation +# Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import print_function, unicode_literals @@ -1376,7 +1376,7 @@ class depgraph(object): selective and \ dep.parent.installed and \ dep.child.installed and \ - dep.parent.cpv == replacement_parent.cpv and \ + dep.parent >= replacement_parent and \ dep.child.cpv == pkg.cpv: # Then can happen if the child's sub-slot changed # without a revision bump. The sub-slot change is diff --git a/pym/portage/tests/resolver/test_slot_conflict_rebuild.py b/pym/portage/tests/resolver/test_slot_conflict_rebuild.py index 5acdadb..17737cf 100644 --- a/pym/portage/tests/resolver/test_slot_conflict_rebuild.py +++ b/pym/portage/tests/resolver/test_slot_conflict_rebuild.py @@ -1,4 +1,4 @@ -# Copyright 2012-2013 Gentoo Foundation +# Copyright 2012-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from portage.tests import TestCase @@ -364,3 +364,45 @@ class SlotConflictRebuildTestCase(TestCase): self.assertEqual(test_case.test_success, True, test_case.fail_msg) finally: playground.cleanup() + + + def testSlotConflictMultiRepo(self): + """ + Bug 497238 + Different repositories contain the same cpv with different sub-slots for + a slot operator child. + Downgrading the slot operator parent would result in a sub-slot change of + the installed package by changing the source repository. + Make sure we don't perform this undesirable rebuild. + """ + ebuilds = { + "net-firewall/iptables-1.4.21::overlay" : { "EAPI": "5", "SLOT": "0/10" }, + "sys-apps/iproute2-3.11.0::overlay" : { "EAPI": "5", "RDEPEND": "net-firewall/iptables:=" }, + + "net-firewall/iptables-1.4.21" : { "EAPI": "5", "SLOT": "0" }, + "sys-apps/iproute2-3.12.0": { "EAPI": "5", "RDEPEND": "net-firewall/iptables:=" }, + } + + installed = { + "net-firewall/iptables-1.4.21::overlay" : { "EAPI": "5", "SLOT": "0/10" }, + "sys-apps/iproute2-3.12.0": { "EAPI": "5", "RDEPEND": "net-firewall/iptables:0/10=" }, + } + + world = ["sys-apps/iproute2"] + + test_cases = ( + ResolverPlaygroundTestCase( + ["@world"], + options = {"--deep": True, "--update": True, "--verbose": True}, + success = True, + 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.cleanup()