cat, atom_pn = portage.catsplit(null_cp)
dbs = self._filtered_trees[root_config.root]["dbs"]
- cp_set = set()
+ categories = set()
for db, pkg_type, built, installed, db_keys in dbs:
- cp_set.update(db.cp_all())
- for cp in list(cp_set):
- cat, pn = portage.catsplit(cp)
- if pn != atom_pn:
- cp_set.discard(cp)
+ for cat in db.categories:
+ if db.cp_list("%s/%s" % (cat, atom_pn)):
+ categories.add(cat)
+
deps = []
- for cp in cp_set:
- have_pkg = False
- for db, pkg_type, built, installed, db_keys in dbs:
- if db.cp_list(cp):
- have_pkg = True
- break
- if not have_pkg:
- continue
- cat, pn = portage.catsplit(cp)
+ for cat in categories:
deps.append(insert_category_into_atom(
atom_without_category, cat))
return deps
cat_pattern = re.compile(r'(.*)/.*')
for cp in self.cp_all():
categories.add(cat_pattern.match(cp).group(1))
- self._categories = list(categories)
- self._categories.sort()
+ self._categories = tuple(sorted(categories))
return self._categories
def close_caches(self):
from portage import settings
self.mysettings = config(clone=settings)
self._iuse_implicit = self.mysettings._get_implicit_iuse()
- self._categories = set(self.mysettings.categories)
+ self._categories = tuple(sorted(set(self.mysettings.categories)))
# This is strictly for use in aux_get() doebuild calls when metadata
# is generated by the depend phase. It's safest to use a clone for
# this purpose because doebuild makes many changes to the config