Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/dep/, pym/_emerge/
Date: Sat, 12 Feb 2011 00:17:04
Message-Id: 5b16e0d800f34dc90cdd8c505172ad16b97f0af4.zmedico@gentoo
1 commit: 5b16e0d800f34dc90cdd8c505172ad16b97f0af4
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Sat Feb 12 00:09:22 2011 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Sat Feb 12 00:09:22 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5b16e0d8
7
8 depgraph: fix distorted display of virtuals
9
10 As mentioned in bug #353933, comment #4, special new-style virtual
11 atoms generated/distorted by _expand_new_virtuals() can prevent
12 extract_affecting_use() from working properly. This is fixed by
13 saving the original atoms so that the depgraph can map them back
14 into place at the appropriate step in dependency evaluation.
15
16 ---
17 pym/_emerge/depgraph.py | 13 +++++++++++++
18 pym/portage/dep/dep_check.py | 6 ++++++
19 2 files changed, 19 insertions(+), 0 deletions(-)
20
21 diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
22 index 0cfd113..91ec250 100644
23 --- a/pym/_emerge/depgraph.py
24 +++ b/pym/_emerge/depgraph.py
25 @@ -1240,6 +1240,12 @@ class depgraph(object):
26 for atom, child in self._minimize_children(
27 pkg, dep_priority, root_config, selected_atoms[pkg]):
28
29 + # If this was a specially generated virtual atom
30 + # from dep_check, map it back to the original, in
31 + # order to avoid distortion in places like display
32 + # or conflict resolution code.
33 + atom = getattr(atom, '_orig_atom', atom)
34 +
35 if ignore_blockers and atom.blocker:
36 # For --with-bdeps, ignore build-time only blockers
37 # that originate from built packages.
38 @@ -1290,6 +1296,13 @@ class depgraph(object):
39
40 for atom, child in self._minimize_children(
41 pkg, self._priority(runtime=True), root_config, atoms):
42 +
43 + # If this was a specially generated virtual atom
44 + # from dep_check, map it back to the original, in
45 + # order to avoid distortion in places like display
46 + # or conflict resolution code.
47 + atom = getattr(atom, '_orig_atom', atom)
48 +
49 # This is a GLEP 37 virtual, so its deps are all runtime.
50 mypriority = self._priority(runtime=True)
51 if not atom.blocker:
52
53 diff --git a/pym/portage/dep/dep_check.py b/pym/portage/dep/dep_check.py
54 index 6d2d99d..ed85be6 100644
55 --- a/pym/portage/dep/dep_check.py
56 +++ b/pym/portage/dep/dep_check.py
57 @@ -135,6 +135,12 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/",
58 pkg_use_enabled(parent))
59 else:
60 virt_atom = Atom(virt_atom)
61 +
62 + # Allow the depgraph to map this atom back to the
63 + # original, in order to avoid distortion in places
64 + # like display or conflict resolution code.
65 + virt_atom.__dict__['_orig_atom'] = x
66 +
67 # According to GLEP 37, RDEPEND is the only dependency
68 # type that is valid for new-style virtuals. Repoman
69 # should enforce this.