from portage.sets.base import PackageSet
from portage.sets import get_boolean
-from portage.dbapi.vartree import dblink
-from portage.versions import catsplit, catpkgsplit
-
-import os
+from portage.versions import catpkgsplit
class LibraryConsumerSet(PackageSet):
_operations = ["merge", "unmerge"]
def mapPathsToAtoms(self, paths):
rValue = set()
- for cpv in self.dbapi.cpv_all():
- mysplit = catsplit(cpv)
- link = dblink(mysplit[0], mysplit[1], myroot=self.dbapi.root, \
- mysettings=self.dbapi.settings, treetype='vartree', \
- vartree=self.dbapi.vartree)
- if paths.intersection(link.getcontents()):
- cat, pn = catpkgsplit(cpv)[:2]
- slot = self.dbapi.aux_get(cpv, ["SLOT"])[0]
- rValue.add("%s/%s:%s" % (cat, pn, slot))
+ root_len = len(self.dbapi.root)
+ for link, relative_p in self.dbapi._owners.iter_owners(
+ p[root_len:] for p in paths):
+ cat, pn = catpkgsplit(link.mycpv)[:2]
+ slot = self.dbapi.aux_get(link.mycpv, ["SLOT"])[0]
+ rValue.add("%s/%s:%s" % (cat, pn, slot))
return rValue
-
class PreservedLibraryConsumerSet(LibraryConsumerSet):
def load(self):