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 CBDCE1382C5 for ; Wed, 28 Mar 2018 05:56:47 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AF034E08ED; Wed, 28 Mar 2018 05:56:46 +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 70C58E08ED for ; Wed, 28 Mar 2018 05:56:46 +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 19C93335C93 for ; Wed, 28 Mar 2018 05:56:45 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id CC24121D for ; Wed, 28 Mar 2018 05:56:42 +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: <1522216310.1879d3ca019ebe4b870c3ee8d80910a90a8e4408.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/_emerge/, man/, pym/portage/tests/resolver/ X-VCS-Repository: proj/portage X-VCS-Files: man/emerge.1 pym/_emerge/create_depgraph_params.py pym/_emerge/depgraph.py pym/_emerge/main.py pym/portage/tests/resolver/test_slot_change_without_revbump.py X-VCS-Directories: pym/_emerge/ man/ pym/portage/tests/resolver/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 1879d3ca019ebe4b870c3ee8d80910a90a8e4408 X-VCS-Branch: master Date: Wed, 28 Mar 2018 05:56:42 +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: 985106c3-4aa6-476b-ba09-ffbb8acc8e88 X-Archives-Hash: a16ba079b69addee0f74aa3997c4ff20 commit: 1879d3ca019ebe4b870c3ee8d80910a90a8e4408 Author: Zac Medico gentoo org> AuthorDate: Mon Mar 26 20:59:57 2018 +0000 Commit: Zac Medico gentoo org> CommitDate: Wed Mar 28 05:51:50 2018 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=1879d3ca emerge: add --changed-slot [ y | n ] option (bug 631358) This is similar to --changed-deps, but for SLOT metadata. Bug: https://bugs.gentoo.org/631358 man/emerge.1 | 7 +++++++ pym/_emerge/create_depgraph_params.py | 6 ++++++ pym/_emerge/depgraph.py | 11 +++++++++++ pym/_emerge/main.py | 13 +++++++++++++ .../resolver/test_slot_change_without_revbump.py | 19 +++++++++++++++++++ 5 files changed, 56 insertions(+) diff --git a/man/emerge.1 b/man/emerge.1 index 27a1193fe..a3c8dd7cd 100644 --- a/man/emerge.1 +++ b/man/emerge.1 @@ -471,6 +471,13 @@ changed since the installed instance was built. Behavior with respect to changed build\-time dependencies is controlled by the \fB\-\-with\-bdeps\fR option. .TP +.BR "\-\-changed\-slot [ y | n ]" +Tells emerge to replace installed packages for which the corresponding +ebuild SLOT metadata has changed since the packages were built. This +option also implies the \fB\-\-selective\fR option. This may also result +in rebuilds for any installed packages that have slot/sub\-slot := +operator dependencies that are sensitive to the relevant SLOT metadata. +.TP .BR \-\-changed\-use ", " \-U Tells emerge to include installed packages where USE flags have changed since installation. This option also implies the diff --git a/pym/_emerge/create_depgraph_params.py b/pym/_emerge/create_depgraph_params.py index ff18f3acc..1fd1f5e36 100644 --- a/pym/_emerge/create_depgraph_params.py +++ b/pym/_emerge/create_depgraph_params.py @@ -30,6 +30,7 @@ def create_depgraph_params(myopts, myaction): # with_test_deps: pull in test deps for packages matched by arguments # changed_deps: rebuild installed packages with outdated deps # changed_deps_report: report installed packages with outdated deps + # changed_slot: rebuild installed packages with outdated SLOT metadata # binpkg_changed_deps: reject binary packages with outdated deps myparams = {"recurse" : True} @@ -64,12 +65,17 @@ def create_depgraph_params(myopts, myaction): if rebuild_if_new_slot is not None: myparams['rebuild_if_new_slot'] = rebuild_if_new_slot + changed_slot = myopts.get('--changed-slot') is True + if changed_slot: + myparams["changed_slot"] = True + if "--update" in myopts or \ "--newrepo" in myopts or \ "--newuse" in myopts or \ "--reinstall" in myopts or \ "--noreplace" in myopts or \ myopts.get("--changed-deps", "n") != "n" or \ + changed_slot or \ myopts.get("--selective", "n") != "n": myparams["selective"] = True diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index ac7ec9d84..6af7d5714 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -2667,6 +2667,10 @@ class depgraph(object): return changed + def _changed_slot(self, pkg): + ebuild = self._equiv_ebuild(pkg) + return ebuild is not None and (ebuild.slot, ebuild.sub_slot) != (pkg.slot, pkg.sub_slot) + def _create_graph(self, allow_unsatisfied=False): dep_stack = self._dynamic_config._dep_stack dep_disjunctive_stack = self._dynamic_config._dep_disjunctive_stack @@ -6474,6 +6478,13 @@ class depgraph(object): modified_use=self._pkg_use_enabled(pkg))): if myeb and "--newrepo" in self._frozen_config.myopts and myeb.repo != pkg.repo: break + elif self._dynamic_config.myparams.get("changed_slot") and self._changed_slot(pkg): + if installed: + break + else: + # Continue searching for a binary package + # with the desired SLOT metadata. + continue elif reinstall_use or (not installed and respect_use): iuses = pkg.iuse.all old_use = self._pkg_use_enabled(pkg) diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py index 147472cbd..4aa9585fa 100644 --- a/pym/_emerge/main.py +++ b/pym/_emerge/main.py @@ -136,6 +136,7 @@ def insert_optional_args(args): '--binpkg-changed-deps' : y_or_n, '--buildpkg' : y_or_n, '--changed-deps' : y_or_n, + '--changed-slot' : y_or_n, '--changed-deps-report' : y_or_n, '--complete-graph' : y_or_n, '--deep' : valid_integers, @@ -416,6 +417,12 @@ def parse_opts(tmpcmdline, silent=False): "choices" : true_y_or_n }, + "--changed-slot": { + "help" : ("replace installed packages with " + "outdated SLOT metadata"), + "choices" : true_y_or_n + }, + "--config-root": { "help":"specify the location for portage configuration files", "action":"store" @@ -852,6 +859,12 @@ def parse_opts(tmpcmdline, silent=False): else: myoptions.changed_deps_report = 'n' + if myoptions.changed_slot is not None: + if myoptions.changed_slot in true_y: + myoptions.changed_slot = True + else: + myoptions.changed_slot = None + if myoptions.changed_use is not False: myoptions.reinstall = "changed-use" myoptions.changed_use = False diff --git a/pym/portage/tests/resolver/test_slot_change_without_revbump.py b/pym/portage/tests/resolver/test_slot_change_without_revbump.py index d85ff7e05..5cd8c53d1 100644 --- a/pym/portage/tests/resolver/test_slot_change_without_revbump.py +++ b/pym/portage/tests/resolver/test_slot_change_without_revbump.py @@ -57,6 +57,25 @@ class SlotChangeWithoutRevBumpTestCase(TestCase): success = True, mergelist = ['app-arch/libarchive-3.1.1', "kde-base/ark-4.10.0"]), + ResolverPlaygroundTestCase( + ["app-arch/libarchive"], + options = {"--noreplace": True, "--usepkg": True}, + success = True, + mergelist = []), + + ResolverPlaygroundTestCase( + ["app-arch/libarchive"], + options = {"--usepkg": True}, + success = True, + mergelist = ["[binary]app-arch/libarchive-3.1.1"]), + + # Test --changed-slot + ResolverPlaygroundTestCase( + ["app-arch/libarchive"], + options = {"--changed-slot": True, "--usepkg": True}, + success = True, + mergelist = ["app-arch/libarchive-3.1.1", "kde-base/ark-4.10.0"]), + ) playground = ResolverPlayground(ebuilds=ebuilds, binpkgs=binpkgs,