Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/dep/
Date: Thu, 28 Aug 2014 08:59:31
Message-Id: 1409216296.ccbaa896448681d42a3b286858c3bd5d912aec56.mgorny@gentoo
1 commit: ccbaa896448681d42a3b286858c3bd5d912aec56
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jul 31 08:44:29 2014 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Thu Aug 28 08:58:16 2014 +0000
6 URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ccbaa896
7
8 vdb: Preserve := when storing uninstalled dependency atoms
9
10 Make the slot operator processing code not remove the := operator from
11 vdb dependency entries when the underlying package is not installed.
12
13 This fixes a bug where dependencies like || ( A:= B:= ) were stored as
14 || ( A:0/1= B ) if B was not installed. This especially confused
15 dependency comparisons in @changed-deps.
16
17 With this patch, Portage stores the original := (or :slot=) atom in the
18 vdb. This fixes the issue while preserving the same behavior in the
19 current dependency resolver.
20
21 Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org>
22 Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>
23 Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>
24
25 ---
26 pym/portage/dep/_slot_operator.py | 27 ++++++++++++++++++---------
27 1 file changed, 18 insertions(+), 9 deletions(-)
28
29 diff --git a/pym/portage/dep/_slot_operator.py b/pym/portage/dep/_slot_operator.py
30 index 7b64444..8b67fc5 100644
31 --- a/pym/portage/dep/_slot_operator.py
32 +++ b/pym/portage/dep/_slot_operator.py
33 @@ -1,4 +1,4 @@
34 -# Copyright 2012-2013 Gentoo Foundation
35 +# Copyright 2012-2014 Gentoo Foundation
36 # Distributed under the terms of the GNU General Public License v2
37
38 from __future__ import unicode_literals
39 @@ -67,6 +67,11 @@ def evaluate_slot_operator_equal_deps(settings, use, trees):
40 return result
41
42 def _eval_deps(dep_struct, vardbs):
43 + # TODO: we'd use a better || () handling, i.e. || ( A:= B:= ) with both A
44 + # and B installed should record subslot on A only since the package is
45 + # supposed to link against that anyway, and we have no guarantee that B
46 + # has matching ABI.
47 +
48 for i, x in enumerate(dep_struct):
49 if isinstance(x, list):
50 _eval_deps(x, vardbs)
51 @@ -87,11 +92,15 @@ def _eval_deps(dep_struct, vardbs):
52 dep_struct[i] = x
53 break
54 else:
55 - # this dep could not be resolved, so remove the operator
56 - # (user may be using package.provided and managing rebuilds
57 - # manually)
58 - if x.slot:
59 - x = x.with_slot(x.slot)
60 - else:
61 - x = x.without_slot
62 - dep_struct[i] = x
63 + # this dep could not be resolved, possibilities include:
64 + # 1. unsatisfied branch of || () dep,
65 + # 2. package.provided,
66 + # 3. --nodeps.
67 + #
68 + # just leave it as-is for now. this does not cause any special
69 + # behavior while keeping the information in vdb -- necessary
70 + # e.g. for @changed-deps to work properly.
71 + #
72 + # TODO: make it actually cause subslot rebuilds when switching
73 + # || () branches.
74 + pass