public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-portage-dev] [PATCH] _pkg_use_enabled: return frozenset (531112)
@ 2014-11-29 16:02 Zac Medico
  2014-12-02 13:10 ` Alexander Berntsen
  0 siblings, 1 reply; 2+ messages in thread
From: Zac Medico @ 2014-11-29 16:02 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Zac Medico

Since commit 9ba4f2aa6a2755a73fb652b4557919047d649fd1, _pkg_use_enabled
needs to consistently return a frozenset, so that the result is
hashable.

Fixes: 9ba4f2aa6a27 ("_slot_operator_update_probe: memoize use_reduce (529660)")
X-Gentoo-Bug: 531112
X-Gentoo-Url: https://bugs.gentoo.org/show_bug.cgi?id=531112
---
 pym/_emerge/depgraph.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index a0169ff..3455b6b 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5321,6 +5321,9 @@ class depgraph(object):
 		If target_use is given, the need changes are computed to make the package useable.
 		Example: target_use = { "foo": True, "bar": False }
 		The flags target_use must be in the pkg's IUSE.
+		@rtype: frozenset
+		@return: set of effectively enabled USE flags, including changes
+			made by autounmask
 		"""
 		if pkg.built:
 			return pkg.use.enabled
@@ -5387,6 +5390,10 @@ class depgraph(object):
 
 			return False
 
+		# Always return frozenset since the result needs to be
+		# hashable (see bug #531112).
+		new_use = frozenset(new_use)
+
 		if new_changes != old_changes:
 			#Don't do the change if it violates REQUIRED_USE.
 			required_use = pkg._metadata.get("REQUIRED_USE")
-- 
2.0.4



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

* Re: [gentoo-portage-dev] [PATCH] _pkg_use_enabled: return frozenset (531112)
  2014-11-29 16:02 [gentoo-portage-dev] [PATCH] _pkg_use_enabled: return frozenset (531112) Zac Medico
@ 2014-12-02 13:10 ` Alexander Berntsen
  0 siblings, 0 replies; 2+ messages in thread
From: Alexander Berntsen @ 2014-12-02 13:10 UTC (permalink / raw
  To: gentoo-portage-dev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

"If you say so"... Go ahead & merge.

- -- 
Alexander
bernalex@gentoo.org
https://secure.plaimi.net/~alexander
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iF4EAREIAAYFAlR9ul8ACgkQRtClrXBQc7UJDgEAiSoHJWzBQYtTfmGFkfms4u32
X2xwWK47iQmI4Za0ofEA/38ZaTATknggH/jIV6o5FItdazFBs4yoXJOKOmZmD6og
=Gxlk
-----END PGP SIGNATURE-----


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

end of thread, other threads:[~2014-12-02 13:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-29 16:02 [gentoo-portage-dev] [PATCH] _pkg_use_enabled: return frozenset (531112) Zac Medico
2014-12-02 13:10 ` Alexander Berntsen

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