Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Cc: Zac Medico <zmedico@g.o>
Subject: [gentoo-portage-dev] [PATCH] More >= atoms for autounmask USE changes (536392)
Date: Sun, 18 Jan 2015 07:13:54
Message-Id: 1421565200-23147-1-git-send-email-zmedico@gentoo.org
1 When checking for packages that will be matched by an autounmask USE
2 change, account for package visibility (masking), so that we can
3 generate more >= atoms (as opposed to = atoms that only match very
4 specific versions). Don't do this for keyword or mask changes, since
5 that may cause undesired versions to be unmasked!
6
7 X-Gentoo-Bug: 536392
8 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=536392
9 ---
10 pym/_emerge/depgraph.py | 13 +++++++++++--
11 1 file changed, 11 insertions(+), 2 deletions(-)
12
13 diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
14 index 1431779..3e9bfdd 100644
15 --- a/pym/_emerge/depgraph.py
16 +++ b/pym/_emerge/depgraph.py
17 @@ -7741,7 +7741,7 @@ class depgraph(object):
18 pretend = "--pretend" in self._frozen_config.myopts
19 enter_invalid = '--ask-enter-invalid' in self._frozen_config.myopts
20
21 - def check_if_latest(pkg):
22 + def check_if_latest(pkg, check_visibility=False):
23 is_latest = True
24 is_latest_in_slot = True
25 dbs = self._dynamic_config._filtered_trees[pkg.root]["dbs"]
26 @@ -7749,6 +7749,9 @@ class depgraph(object):
27
28 for db, pkg_type, built, installed, db_keys in dbs:
29 for other_pkg in self._iter_match_pkgs(root_config, pkg_type, Atom(pkg.cp)):
30 + if (check_visibility and
31 + not self._pkg_visibility_check(other_pkg)):
32 + continue
33 if other_pkg.cp != pkg.cp:
34 # old-style PROVIDE virtual means there are no
35 # normal matches for this pkg_type
36 @@ -7848,7 +7851,13 @@ class depgraph(object):
37 root = pkg.root
38 roots.add(root)
39 use_changes_msg.setdefault(root, [])
40 - is_latest, is_latest_in_slot = check_if_latest(pkg)
41 + # NOTE: For USE changes, call check_if_latest with
42 + # check_visibility=True, since we want to generate
43 + # a >= atom if possible. Don't do this for keyword
44 + # or mask changes, since that may cause undesired
45 + # versions to be unmasked! See bug #536392.
46 + is_latest, is_latest_in_slot = check_if_latest(
47 + pkg, check_visibility=True)
48 changes = needed_use_config_change[1]
49 adjustments = []
50 for flag, state in changes.items():
51 --
52 2.0.5

Replies