Continue to support profile masking at least until bug #170697 is settled.
authorZac Medico <zmedico@gentoo.org>
Mon, 26 Mar 2007 20:09:35 +0000 (20:09 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 26 Mar 2007 20:09:35 +0000 (20:09 -0000)
svn path=/main/trunk/; revision=6292

pym/portage/dbapi/porttree.py

index af14499d67380a735061e47dc12deb8786ab9a07..11182d1c163db689f910b6b7999f1bee40a20d08 100644 (file)
@@ -622,6 +622,19 @@ class portdbapi(dbapi):
                                                except ValueError:
                                                        pass
 
+               profile_atoms = self.mysettings.prevmaskdict.get(mycp)
+               if profile_atoms:
+                       for x in profile_atoms:
+                               #important: only match against the still-unmasked entries...
+                               #notice how we pass "newlist" to the xmatch() call below....
+                               #Without this, ~ deps in the packages files are broken.
+                               mymatches=self.xmatch("match-list",x,mylist=newlist)
+                               if mymatches is None:
+                                       #error in packages file; print warning and continue:
+                                       print "emerge: visible(): profile packages entry \""+x+"\" is invalid, ignoring..."
+                                       continue
+                               newlist = [cpv for cpv in newlist if cpv in mymatches]
+
                return newlist
 
        def gvisible(self,mylist):