public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-portage-dev] [PATCH] More >= atoms for autounmask USE changes (536392)
@ 2015-01-18  7:13 Zac Medico
  2015-01-18 17:05 ` Brian Dolbec
  0 siblings, 1 reply; 2+ messages in thread
From: Zac Medico @ 2015-01-18  7:13 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Zac Medico

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
---
 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():
-- 
2.0.5



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [gentoo-portage-dev] [PATCH] More >= atoms for autounmask USE changes (536392)
  2015-01-18  7:13 [gentoo-portage-dev] [PATCH] More >= atoms for autounmask USE changes (536392) Zac Medico
@ 2015-01-18 17:05 ` Brian Dolbec
  0 siblings, 0 replies; 2+ messages in thread
From: Brian Dolbec @ 2015-01-18 17:05 UTC (permalink / raw
  To: gentoo-portage-dev

On Sat, 17 Jan 2015 23:13:20 -0800
Zac Medico <zmedico@gentoo.org> wrote:

> 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
> ---
>  pym/_emerge/depgraph.py | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
> 

looks good, merge please


-- 
Brian Dolbec <dolsen>



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-18 17:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-18  7:13 [gentoo-portage-dev] [PATCH] More >= atoms for autounmask USE changes (536392) Zac Medico
2015-01-18 17:05 ` Brian Dolbec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox