For bug #150585, stack package.keywords incrementally so that -keyword works as expec...
authorZac Medico <zmedico@gentoo.org>
Thu, 23 Nov 2006 03:13:43 +0000 (03:13 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 23 Nov 2006 03:13:43 +0000 (03:13 -0000)
svn path=/main/trunk/; revision=5121

pym/portage.py

index 5422e653ac9e59ff0b24ae7ff99b5388a362193d..cebf647615e39c66654acd8637887f2ea08eba6a 100644 (file)
@@ -4082,6 +4082,19 @@ def getmaskingstatus(mycpv, settings=None, portdb=None):
                matches = match_to_list(mycpv, pkgdict[cp].keys())
                for match in matches:
                        pgroups.extend(pkgdict[cp][match])
+               if matches:
+                       inc_pgroups = []
+                       for x in pgroups:
+                               if x != "-*" and x.startswith("-"):
+                                       try:
+                                               inc_pgroups.remove(x[1:])
+                                       except ValueError:
+                                               pass
+                                       continue
+                               if x not in inc_pgroups:
+                                       inc_pgroups.append(x)
+                       pgroups = inc_pgroups
+                       del inc_pgroups
 
        kmask = "missing"
 
@@ -5583,6 +5596,19 @@ class portdbapi(dbapi):
                                matches = match_to_list(mycpv, pkgdict[cp].keys())
                                for atom in matches:
                                        pgroups.extend(pkgdict[cp][atom])
+                               if matches:
+                                       inc_pgroups = []
+                                       for x in pgroups:
+                                               if x != "-*" and x.startswith("-"):
+                                                       try:
+                                                               inc_pgroups.remove(x[1:])
+                                                       except ValueError:
+                                                               pass
+                                                       continue
+                                               if x not in inc_pgroups:
+                                                       inc_pgroups.append(x)
+                                       pgroups = inc_pgroups
+                                       del inc_pgroups
                        hasstable = False
                        hastesting = False
                        for gp in mygroups:
@@ -5591,9 +5617,6 @@ class portdbapi(dbapi):
                                                noiselevel=-1)
                                        match=1
                                        break
-                               elif "-"+gp in pgroups:
-                                       match=0
-                                       break
                                elif gp in pgroups:
                                        match=1
                                        break