Gentoo Archives: gentoo-portage-dev

From: Brian Dolbec <dolsen@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH] Another slot operator bug (bug 486580, try 2)
Date: Sun, 01 Dec 2013 10:23:01
Message-Id: 1385893376.3897.40.camel@big_daddy.dol-sen.ca
In Reply to: Re: [gentoo-portage-dev] [PATCH] Another slot operator bug (bug 486580, try 2) by Brian Dolbec
1 On Thu, 2013-11-28 at 17:00 -0800, Brian Dolbec wrote:
2 > On Thu, 2013-11-28 at 20:36 +0100, Sebastian Luther wrote:
3 > >
4 > > In fact there's some duplication between the two blocks. Feel free to
5 > > clean this up after it has been pushed.
6 > >
7 >
8 > OK, thanks, I'll look to see if it can be optimized a little more.
9
10 Applied along with:
11
12 The mypriority.satisfied check was common to both the if statement and
13 the return. So doing that check first provides an early return if it is
14 False. If mypriority.satisfied is True/not None, then it is done only
15 once and does not affect the final truth table returned.
16
17 diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
18 index 622d288..343cc03 100644
19 @@ -2276,10 +2276,11 @@ class depgraph(object):
20 Don't ignore dependencies if pkg has a slot operator dependency on
21 the child
22 and the child has changed slot/sub_slot.
23 """
24 + if not mypriority.satisfied:
25 + return False
26 slot_operator_rebuild = False
27 if atom.slot_operator == '=' and \
28 (pkg.root, pkg.slot_atom) in
29 self._dynamic_config._slot_operator_replace_installed and \
30 - mypriority.satisfied and \
31 mypriority.satisfied is not child and \
32 mypriority.satisfied.installed and \
33 not child.installed and \
34 @@ -2288,7 +2289,6 @@ class depgraph(object):
35
36 return not atom.blocker and \
37 not recurse_satisfied and \
38 - mypriority.satisfied and \
39 mypriority.satisfied.visible and \
40 dep.child is not None and \
41 not dep.child.installed and \

Attachments

File name MIME type
signature.asc application/pgp-signature