Gentoo Archives: gentoo-portage-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-portage-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-portage-dev] [PATCH] slot op: do not remove := from vdb on unmatched dependencies.
Date: Thu, 31 Jul 2014 08:57:07
Message-Id: 1406797040-24378-1-git-send-email-mgorny@gentoo.org
1 Previously, the slot operator processing code used to remove := operator
2 from vdb dependency entries when the underlying package was not
3 installed. With regards to a dependency alike || ( A:= B:= ), this
4 suggested that the particular slot/subslot of installed package could
5 be replaced by any slot/subslot of the other package. In particular, it
6 confused dependency comparison in @changed-deps.
7
8 Instead, store the original := (or :slot=) atom in vdb. It does not
9 trigger any special behavior in the current dependency resolver, yet
10 keeps the extra information. It also makes proper @changed-deps
11 comparisons possible since the comparison code can know if the original
12 ebuild had the slot operator.
13 ---
14 pym/portage/dep/_slot_operator.py | 25 +++++++++++++++++--------
15 1 file changed, 17 insertions(+), 8 deletions(-)
16
17 diff --git a/pym/portage/dep/_slot_operator.py b/pym/portage/dep/_slot_operator.py
18 index 7b64444..7902e56 100644
19 --- a/pym/portage/dep/_slot_operator.py
20 +++ b/pym/portage/dep/_slot_operator.py
21 @@ -67,6 +67,11 @@ def evaluate_slot_operator_equal_deps(settings, use, trees):
22 return result
23
24 def _eval_deps(dep_struct, vardbs):
25 + # TODO: we'd use a better || () handling, i.e. || ( A:= B:= ) with both A
26 + # and B installed should record subslot on A only since the package is
27 + # supposed to link against that anyway, and we have no guarantee that B
28 + # has matching ABI.
29 +
30 for i, x in enumerate(dep_struct):
31 if isinstance(x, list):
32 _eval_deps(x, vardbs)
33 @@ -87,11 +92,15 @@ def _eval_deps(dep_struct, vardbs):
34 dep_struct[i] = x
35 break
36 else:
37 - # this dep could not be resolved, so remove the operator
38 - # (user may be using package.provided and managing rebuilds
39 - # manually)
40 - if x.slot:
41 - x = x.with_slot(x.slot)
42 - else:
43 - x = x.without_slot
44 - dep_struct[i] = x
45 + # this dep could not be resolved, possibilities include:
46 + # 1. unsatisfied branch of || () dep,
47 + # 2. package.provided,
48 + # 3. --nodeps.
49 + #
50 + # just leave it as-is for now. this does not cause any special
51 + # behavior while keeping the information in vdb -- necessary
52 + # e.g. for @changed-deps to work properly.
53 + #
54 + # TODO: make it actually cause subslot rebuilds when switching
55 + # || () branches.
56 + pass
57 --
58 2.0.2

Replies