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 1/3] vardb: Do not remove := from vdb on unmatched dependencies
Date: Wed, 13 Aug 2014 17:20:11
Message-Id: 1407950435-2520-2-git-send-email-mgorny@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCHES] @changed-deps + missing slot check reposted for bernalex by "Michał Górny"
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 | 27 ++++++++++++++++++---------
15 1 file changed, 18 insertions(+), 9 deletions(-)
16
17 diff --git a/pym/portage/dep/_slot_operator.py b/pym/portage/dep/_slot_operator.py
18 index 7b64444..8b67fc5 100644
19 --- a/pym/portage/dep/_slot_operator.py
20 +++ b/pym/portage/dep/_slot_operator.py
21 @@ -1,4 +1,4 @@
22 -# Copyright 2012-2013 Gentoo Foundation
23 +# Copyright 2012-2014 Gentoo Foundation
24 # Distributed under the terms of the GNU General Public License v2
25
26 from __future__ import unicode_literals
27 @@ -67,6 +67,11 @@ def evaluate_slot_operator_equal_deps(settings, use, trees):
28 return result
29
30 def _eval_deps(dep_struct, vardbs):
31 + # TODO: we'd use a better || () handling, i.e. || ( A:= B:= ) with both A
32 + # and B installed should record subslot on A only since the package is
33 + # supposed to link against that anyway, and we have no guarantee that B
34 + # has matching ABI.
35 +
36 for i, x in enumerate(dep_struct):
37 if isinstance(x, list):
38 _eval_deps(x, vardbs)
39 @@ -87,11 +92,15 @@ def _eval_deps(dep_struct, vardbs):
40 dep_struct[i] = x
41 break
42 else:
43 - # this dep could not be resolved, so remove the operator
44 - # (user may be using package.provided and managing rebuilds
45 - # manually)
46 - if x.slot:
47 - x = x.with_slot(x.slot)
48 - else:
49 - x = x.without_slot
50 - dep_struct[i] = x
51 + # this dep could not be resolved, possibilities include:
52 + # 1. unsatisfied branch of || () dep,
53 + # 2. package.provided,
54 + # 3. --nodeps.
55 + #
56 + # just leave it as-is for now. this does not cause any special
57 + # behavior while keeping the information in vdb -- necessary
58 + # e.g. for @changed-deps to work properly.
59 + #
60 + # TODO: make it actually cause subslot rebuilds when switching
61 + # || () branches.
62 + pass
63 --
64 2.0.4