Fix _getMissingProperties() package.properties handling so that settings
authorZac Medico <zmedico@gentoo.org>
Sat, 7 Aug 2010 01:06:59 +0000 (18:06 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 7 Aug 2010 01:06:59 +0000 (18:06 -0700)
from more specific atoms override those of less specific atoms.

pym/portage/package/ebuild/config.py

index 344810543ee7647b8f63eb801ba7fdeeff7da2e2..0540151a0e73c6851b075071fc0a27df3ef8f4b0 100644 (file)
@@ -1966,10 +1966,22 @@ class config(object):
                cp = cpv_getkey(cpv)
                cpdict = self._ppropertiesdict.get(cp)
                if cpdict:
-                       accept_properties = list(self._accept_properties)
                        cpv_slot = "%s:%s" % (cpv, metadata["SLOT"])
-                       for atom in match_to_list(cpv_slot, list(cpdict)):
-                               accept_properties.extend(cpdict[atom])
+                       keys = list(cpdict)
+                       pproperties_list = []
+                       while keys:
+                               bestmatch = best_match_to_list(cpv_slot, keys)
+                               if bestmatch:
+                                       keys.remove(bestmatch)
+                                       pproperties_list.append(cpdict[bestmatch])
+                               else:
+                                       break
+                       if pproperties_list:
+                               # reverse, so the most specific atoms come last
+                               pproperties_list.reverse()
+                               accept_properties = list(self._accept_properties)
+                               for x in pproperties_list:
+                                       accept_properties.extend(x)
 
                properties = set(flatten(use_reduce(paren_reduce(
                        metadata["PROPERTIES"]), matchall=1)))