public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Zac Medico <zmedico@gentoo.org>
To: gentoo-portage-dev@lists.gentoo.org
Cc: SebastianLuther@gmx.de, arfrever.fta@gmail.com
Subject: [gentoo-portage-dev] [PATCH] _slot_operator_update_probe: fix bug #520856
Date: Sat, 30 Aug 2014 00:40:20 -0700	[thread overview]
Message-ID: <54017FE4.4000203@gentoo.org> (raw)

This fixes the check_reverse_dependencies function (inside the depgraph
_slot_operator_update_probe method) to account for irrelevant parent
atoms from parents that need to be rebuilt or have been involved in
unsolved slot conflicts.

X-Gentoo-Bug: 520856
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=520856
---
 pym/_emerge/depgraph.py | 35 +++++++++++++++++++++++++++++++----
 1 file changed, 31 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 845a43a..d6cd24d 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1567,14 +1567,40 @@ class depgraph(object):
 		selective = "selective" in self._dynamic_config.myparams
 		want_downgrade = None
 
-		def check_reverse_dependencies(existing_pkg, candidate_pkg):
+		def check_reverse_dependencies(existing_pkg, candidate_pkg,
+			replacement_parent=None):
 			"""
 			Check if candidate_pkg satisfies all of existing_pkg's non-
 			slot operator parents.
 			"""
+			built_slot_operator_parents = set()
 			for parent, atom in self._dynamic_config._parent_atoms.get(existing_pkg, []):
-				if atom.slot_operator == "=" and getattr(parent, "built", False):
-					continue
+				if atom.slot_operator_built:
+					built_slot_operator_parents.add(parent)
+
+			for parent, atom in self._dynamic_config._parent_atoms.get(existing_pkg, []):
+				if isinstance(parent, Package):
+					if parent in built_slot_operator_parents:
+						# This parent may need to be rebuilt, so its
+						# dependencies aren't necessarily relevant.
+						continue
+
+					if replacement_parent is not None and \
+						(replacement_parent.slot_atom == parent.slot_atom
+						or replacement_parent.cpv == parent.cpv):
+						# This parent is irrelevant because we intend to
+						# replace it with replacement_parent.
+						continue
+
+					if any(pkg is not parent and
+						(pkg.slot_atom == parent.slot_atom or
+						pkg.cpv == parent.cpv) for pkg in
+						self._dynamic_config._package_tracker.match(
+						parent.root, Atom(parent.cp))):
+						# This parent may need to be eliminated due to a
+						# slot conflict,  so its dependencies aren't
+						# necessarily relevant.
+						continue
 
 				atom_set = InternalPackageSet(initial_atoms=(atom,),
 					allow_repo=True)
@@ -1693,7 +1719,8 @@ class depgraph(object):
 							continue
 
 					if not insignificant and \
-						check_reverse_dependencies(dep.child, pkg):
+						check_reverse_dependencies(dep.child, pkg,
+							replacement_parent=replacement_parent):
 
 						candidate_pkg_atoms.append((pkg, unevaluated_atom))
 						candidate_pkgs.append(pkg)
-- 
1.8.1.5


             reply	other threads:[~2014-08-30  7:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-30  7:40 Zac Medico [this message]
2014-08-31 14:52 ` [gentoo-portage-dev] [PATCH] _slot_operator_update_probe: fix bug #520856 Brian Dolbec
2014-09-01 17:10   ` Zac Medico

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54017FE4.4000203@gentoo.org \
    --to=zmedico@gentoo.org \
    --cc=SebastianLuther@gmx.de \
    --cc=arfrever.fta@gmail.com \
    --cc=gentoo-portage-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox