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 2726D13877A for ; Thu, 28 Aug 2014 16:07:36 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1A152E08C1; Thu, 28 Aug 2014 16:07:35 +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 B3008E08C1 for ; Thu, 28 Aug 2014 16:07:34 +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 5DED633F3DB for ; Thu, 28 Aug 2014 16:07:33 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 071D39F6 for ; Thu, 28 Aug 2014 16:07:32 +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: <1409241762.617a64f77055ddda1dd86a506cf98f5adc545fae.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/dep/, pym/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: pym/_emerge/depgraph.py pym/portage/dep/dep_check.py X-VCS-Directories: pym/portage/dep/ pym/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 617a64f77055ddda1dd86a506cf98f5adc545fae X-VCS-Branch: master Date: Thu, 28 Aug 2014 16:07:32 +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: a8a76ea0-a5cd-4746-a119-7e65dd426c2f X-Archives-Hash: 15d90baf6512ceca3dab5c0e6ea27923 commit: 617a64f77055ddda1dd86a506cf98f5adc545fae Author: Zac Medico gentoo org> AuthorDate: Thu Aug 28 00:07:10 2014 +0000 Commit: Zac Medico gentoo org> CommitDate: Thu Aug 28 16:02:42 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=617a64f7 dep_check: fix bug #515230 This fixes dep_check so that graph packages do not mask non-graph packages (in the same slot) unless the graph packages also match the dependency atom being satisfied. This requires logic changes in both _dep_check_composite_db._visible and dep_zapdeps. Also, fix _dep_check_composite_db match / _cpv_pkg_map interactions to ensure correct match results. X-Gentoo-Bug: 515230 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=515230 --- pym/_emerge/depgraph.py | 30 +++++++++++++++++++----------- pym/portage/dep/dep_check.py | 10 +++++----- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index a10297a..845a43a 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -8259,18 +8259,20 @@ class _dep_check_composite_db(dbapi): return ret - def match(self, atom): + def match_pkgs(self, atom): cache_key = (atom, atom.unevaluated_atom) ret = self._match_cache.get(cache_key) if ret is not None: + for pkg in ret: + self._cpv_pkg_map[pkg.cpv] = pkg return ret[:] + atom_set = InternalPackageSet(initial_atoms=(atom,)) ret = [] pkg, existing = self._depgraph._select_package(self._root, atom) - if pkg is not None and self._visible(pkg): - self._cpv_pkg_map[pkg.cpv] = pkg - ret.append(pkg.cpv) + if pkg is not None and self._visible(pkg, atom_set): + ret.append(pkg) if pkg is not None and \ atom.slot is None and \ @@ -8301,18 +8303,19 @@ class _dep_check_composite_db(dbapi): self._root, slot_atom) if not pkg: continue - if not self._visible(pkg): + if not self._visible(pkg, atom_set): continue - self._cpv_pkg_map[pkg.cpv] = pkg - ret.append(pkg.cpv) + ret.append(pkg) if len(ret) > 1: - self._cpv_sort_ascending(ret) + ret.sort() self._match_cache[cache_key] = ret + for pkg in ret: + self._cpv_pkg_map[pkg.cpv] = pkg return ret[:] - def _visible(self, pkg): + def _visible(self, pkg, atom_set): if pkg.installed and not self._depgraph._want_installed_pkg(pkg): return False if pkg.installed and \ @@ -8350,6 +8353,11 @@ class _dep_check_composite_db(dbapi): elif in_graph != pkg: # Mask choices for packages that would trigger a slot # conflict with a previously selected package. + if not atom_set.findAtomForPackage(in_graph, + modified_use=self._depgraph._pkg_use_enabled(in_graph)): + # Only mask if the graph package matches the given + # atom (fixes bug #515230). + return True return False return True @@ -8357,8 +8365,8 @@ class _dep_check_composite_db(dbapi): metadata = self._cpv_pkg_map[cpv]._metadata return [metadata.get(x, "") for x in wants] - def match_pkgs(self, atom): - return [self._cpv_pkg_map[cpv] for cpv in self.match(atom)] + def match(self, atom): + return [pkg.cpv for pkg in self.match_pkgs(atom)] def ambiguous_package_name(arg, atoms, root_config, spinner, myopts): diff --git a/pym/portage/dep/dep_check.py b/pym/portage/dep/dep_check.py index b79c5bc..22eed96 100644 --- a/pym/portage/dep/dep_check.py +++ b/pym/portage/dep/dep_check.py @@ -1,4 +1,4 @@ -# Copyright 2010-2013 Gentoo Foundation +# Copyright 2010-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import unicode_literals @@ -414,16 +414,16 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None): unsat_use_non_installed.append(this_choice) else: all_in_graph = True - for slot_atom in slot_map: + for atom in atoms: # New-style virtuals have zero cost to install. - if slot_atom.startswith("virtual/"): + if atom.blocker or atom.cp.startswith("virtual/"): continue # We check if the matched package has actually been # added to the digraph, in order to distinguish between # those packages and installed packages that may need # to be uninstalled in order to resolve blockers. - graph_matches = graph_db.match_pkgs(slot_atom) - if not graph_matches or graph_matches[-1] not in graph: + if not any(pkg in graph for pkg in + graph_db.match_pkgs(atom)): all_in_graph = False break circular_atom = None