--- portage.py.org 2003-11-03 19:28:09.000000000 +0000 +++ portage.py 2003-11-04 02:31:14.000000000 +0000 @@ -4712,13 +4712,15 @@ for myvirt in myvirts.keys(): newvirts[myvirt]=[] for mykey in myvirts[myvirt]: - if mykey == self.cat+"/"+pkgsplit(self.pkg)[0]: - if myprovides.has_key(myvirt) and \ - (self.cat+"/"+self.pkg in myprovides[myvirt]) and \ - (len(myprovides[myvirt]) > 1): - if mykey not in newvirts[myvirt]: - newvirts[myvirt].append(mykey) - writemsg("--- Leaving virtual '"+mykey+"' from '"+myvirt+"'\n") + if mykey == self.cat+"/"+pkgsplit(self.pkg)[0] and myprovides[myvirt].count(self.cat+"/"+self.pkg)>0: + # remove myself first + myprovides[myvirt].remove(self.cat+"/"+self.pkg) + for x in myprovides[myvirt]: + if pkgsplit(x)[0]==mykey: + if mykey not in newvirts[myvirt]: + newvirts[myvirt].append(mykey) + writemsg("--- Leaving virtual '"+mykey+"' from '"+myvirt+"'\n") + break else: writemsg("<<< Removing virtual '"+mykey+"' from '"+myvirt+"'\n") else: @@ -4726,6 +4728,8 @@ newvirts[myvirt].append(mykey) if newvirts[myvirt]==[]: del newvirts[myvirt] + writemsg("<<< Removing virtual '"+myvirt+"'\n") + writedict(newvirts,self.myroot+"var/cache/edb/virtuals") #do original postrm