Make atoms with wildcards work in package.mask and package.unmask
authorSebastian Luther <SebastianLuther@gmx.de>
Fri, 23 Jul 2010 10:26:13 +0000 (12:26 +0200)
committerZac Medico <zmedico@gentoo.org>
Fri, 23 Jul 2010 16:47:13 +0000 (09:47 -0700)
pym/portage/package/ebuild/config.py

index 9e55cc883657e4cef457ebdf01342b75e2b74ffa..3ba8cc311009de842ffab2db4031c33c0d4ee008 100644 (file)
@@ -1714,10 +1714,19 @@ class config(object):
                """
 
                cp = cpv_getkey(cpv)
-               mask_atoms = self.pmaskdict.get(cp)
+               c, p = catsplit(cp)
+               mask_atoms = []
+               mask_atoms.extend(self.pmaskdict.get("*/*", []))
+               mask_atoms.extend(self.pmaskdict.get(c+"/*", []))
+               mask_atoms.extend(self.pmaskdict.get("*/"+p, []))
+               mask_atoms.extend(self.pmaskdict.get(cp, []))
                if mask_atoms:
                        pkg_list = ["%s:%s" % (cpv, metadata["SLOT"])]
-                       unmask_atoms = self.punmaskdict.get(cp)
+                       unmask_atoms = []
+                       unmask_atoms.extend(self.punmaskdict.get("*/*", []))
+                       unmask_atoms.extend(self.punmaskdict.get(c+"/*", []))
+                       unmask_atoms.extend(self.punmaskdict.get("*/"+p, []))
+                       unmask_atoms.extend(self.punmaskdict.get(cp, []))
                        for x in mask_atoms:
                                if not match_from_list(x, pkg_list):
                                        continue