commit:     0b85e54ce3de54d8b1dfaf2c3f3b23b5326d4c44
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 18 07:11:54 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jan 18 18:44:45 2015 +0000
URL:        
http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0b85e54c

More >= atoms for autounmask USE changes (536392)

When checking for packages that will be matched by an autounmask USE
change, account for package visibility (masking), so that we can
generate more >= atoms (as opposed to = atoms that only match very
specific versions). Don't do this for keyword or mask changes, since
that may cause undesired versions to be unmasked!

X-Gentoo-Bug: 536392
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=536392
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

---
 pym/_emerge/depgraph.py | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 1431779..3e9bfdd 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -7741,7 +7741,7 @@ class depgraph(object):
                pretend = "--pretend" in self._frozen_config.myopts
                enter_invalid = '--ask-enter-invalid' in 
self._frozen_config.myopts
 
-               def check_if_latest(pkg):
+               def check_if_latest(pkg, check_visibility=False):
                        is_latest = True
                        is_latest_in_slot = True
                        dbs = 
self._dynamic_config._filtered_trees[pkg.root]["dbs"]
@@ -7749,6 +7749,9 @@ class depgraph(object):
 
                        for db, pkg_type, built, installed, db_keys in dbs:
                                for other_pkg in 
self._iter_match_pkgs(root_config, pkg_type, Atom(pkg.cp)):
+                                       if (check_visibility and
+                                               not 
self._pkg_visibility_check(other_pkg)):
+                                               continue
                                        if other_pkg.cp != pkg.cp:
                                                # old-style PROVIDE virtual 
means there are no
                                                # normal matches for this 
pkg_type
@@ -7848,7 +7851,13 @@ class depgraph(object):
                                root = pkg.root
                                roots.add(root)
                                use_changes_msg.setdefault(root, [])
-                               is_latest, is_latest_in_slot = 
check_if_latest(pkg)
+                               # NOTE: For USE changes, call check_if_latest 
with
+                               # check_visibility=True, since we want to 
generate
+                               # a >= atom if possible. Don't do this for 
keyword
+                               # or mask changes, since that may cause 
undesired
+                               # versions to be unmasked! See bug #536392.
+                               is_latest, is_latest_in_slot = check_if_latest(
+                                       pkg, check_visibility=True)
                                changes = needed_use_config_change[1]
                                adjustments = []
                                for flag, state in changes.items():

Reply via email to