summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/_emerge/__init__.py21
-rw-r--r--pym/portage/dbapi/__init__.py3
-rw-r--r--pym/portage/dbapi/porttree.py2
3 files changed, 8 insertions, 18 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index a5802bbe5..be50a6386 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -5274,23 +5274,14 @@ class depgraph(object):
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
diff --git a/pym/portage/dbapi/__init__.py b/pym/portage/dbapi/__init__.py
index e5db363d7..dae7ad014 100644
--- a/pym/portage/dbapi/__init__.py
+++ b/pym/portage/dbapi/__init__.py
@@ -38,8 +38,7 @@ class dbapi(object):
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):
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index 77e6ae494..d342c22d9 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -94,7 +94,7 @@ class portdbapi(dbapi):
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