Fix Package.metadata USE conditional evaluation so that it's delayed until
authorZac Medico <zmedico@gentoo.org>
Sun, 28 Jun 2009 20:37:50 +0000 (20:37 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 28 Jun 2009 20:37:50 +0000 (20:37 -0000)
after config.setcpv() has calculated PORTAGE_USE. Thanks to Arfrever for
reporting.

svn path=/main/trunk/; revision=13729

pym/portage/__init__.py

index 41da40cf763f4dbdb185070e9affcad8daad6b7d..720bf0d4b332b866558ea0fba4d99896cf2ca22c 100644 (file)
@@ -2250,9 +2250,12 @@ class config(object):
                if mydb:
                        if not hasattr(mydb, "aux_get"):
                                for k in aux_keys:
-                                       v = mydb.get(k)
-                                       if v is not None:
-                                               pkg_configdict[k] = v
+                                       if k in mydb:
+                                               # Make these lazy, since __getitem__ triggers
+                                               # evaluation of USE conditionals which can't
+                                               # occur until PORTAGE_USE is calculated below.
+                                               pkg_configdict.addLazySingleton(k,
+                                                       mydb.__getitem__, k)
                        else:
                                for k, v in izip(aux_keys, mydb.aux_get(self.mycpv, aux_keys)):
                                        pkg_configdict[k] = v