From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 5EF4D1382C5 for ; Thu, 12 Apr 2018 02:45:45 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 826EDE0900; Thu, 12 Apr 2018 02:45:44 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4F283E0900 for ; Thu, 12 Apr 2018 02:45:43 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B7DB1335C2C for ; Thu, 12 Apr 2018 02:45:42 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 773F2281 for ; Thu, 12 Apr 2018 02:45:40 +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: <1523501027.600b329949f8770fe2962987ee97567b65393c7e.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_slot_operator_rebuild.py X-VCS-Directories: pym/_emerge/ pym/portage/tests/resolver/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 600b329949f8770fe2962987ee97567b65393c7e X-VCS-Branch: master Date: Thu, 12 Apr 2018 02:45:40 +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: cd154b03-19cd-4e36-b7e6-4f9bca45ff5d X-Archives-Hash: f08f1055417a6624cb8d2b1f281b6ec9 commit: 600b329949f8770fe2962987ee97567b65393c7e Author: Zac Medico gentoo org> AuthorDate: Tue Apr 10 21:29:44 2018 +0000 Commit: Zac Medico gentoo org> CommitDate: Thu Apr 12 02:43:47 2018 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=600b3299 _slot_operator.._reinstalls: probe binpkg rebuild (bug 652938) If the parent is not installed, check if it needs to be rebuilt against an installed instance, since otherwise it could trigger downgrade of an installed instance. Bug: https://bugs.gentoo.org/652938 Reviewed-by: Manuel RĂ¼ger gentoo.org> pym/_emerge/depgraph.py | 10 ++++- .../tests/resolver/test_slot_operator_rebuild.py | 45 +++++++++++++++++++++- 2 files changed, 51 insertions(+), 4 deletions(-) diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 160ea5e94..67f912f5e 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -2571,17 +2571,23 @@ class depgraph(object): isinstance(dep.parent, Package) and dep.parent.built): continue + # If the parent is not installed, check if it needs to be + # rebuilt against an installed instance, since otherwise + # it could trigger downgrade of an installed instance as + # in bug #652938. + want_update_probe = dep.want_update or not dep.parent.installed + # Check for slot update first, since we don't want to # trigger reinstall of the child package when a newer # slot will be used instead. - if rebuild_if_new_slot and dep.want_update: + if rebuild_if_new_slot and want_update_probe: new_dep = self._slot_operator_update_probe(dep, new_child_slot=True) if new_dep is not None: self._slot_operator_update_backtrack(dep, new_child_slot=new_dep.child) - if dep.want_update: + if want_update_probe: if self._slot_operator_update_probe(dep): self._slot_operator_update_backtrack(dep) diff --git a/pym/portage/tests/resolver/test_slot_operator_rebuild.py b/pym/portage/tests/resolver/test_slot_operator_rebuild.py index 42512aad8..381683331 100644 --- a/pym/portage/tests/resolver/test_slot_operator_rebuild.py +++ b/pym/portage/tests/resolver/test_slot_operator_rebuild.py @@ -1,4 +1,4 @@ -# Copyright 2014 Gentoo Foundation +# Copyright 2014-2018 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from portage.tests import TestCase @@ -31,6 +31,32 @@ class SlotOperatorRebuildTestCase(TestCase): "RDEPEND": "|| ( app-misc/X app-misc/A:= )" }, + "app-misc/D-1" : { + "EAPI": "6", + "RDEPEND": "app-misc/E", + }, + + "app-misc/E-1" : { + "EAPI": "6", + "RDEPEND": "app-misc/F:=", + }, + + "app-misc/F-1" : { + "EAPI": "6", + "SLOT": "0/1" + }, + + "app-misc/F-2" : { + "EAPI": "6", + "SLOT": "0/2" + }, + } + + binpkgs = { + "app-misc/E-1" : { + "EAPI": "6", + "RDEPEND": "app-misc/F:0/1=", + }, } installed = { @@ -50,6 +76,10 @@ class SlotOperatorRebuildTestCase(TestCase): "RDEPEND": "|| ( app-misc/X app-misc/A:0/1= )" }, + "app-misc/F-2" : { + "EAPI": "6", + "SLOT": "0/2" + }, } world = ["app-misc/B", "app-misc/C"] @@ -68,9 +98,20 @@ class SlotOperatorRebuildTestCase(TestCase): mergelist = ['app-misc/A-2', ('app-misc/B-0', 'app-misc/C-0')] ), + # Test bug #652938, where a binary package built against an + # older subslot triggered downgrade of an installed package. + # In this case we want to reject the app-misc/E-1 binary + # package, and rebuild it against the installed instance of + # app-misc/F. + ResolverPlaygroundTestCase( + ["app-misc/D"], + options = {'--usepkg': True}, + success = True, + mergelist = ['app-misc/E-1', 'app-misc/D-1'] + ), ) - playground = ResolverPlayground(ebuilds=ebuilds, + playground = ResolverPlayground(ebuilds=ebuilds, binpkgs=binpkgs, installed=installed, world=world, debug=False) try: for test_case in test_cases: