summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage/dbapi/__init__.py1
-rw-r--r--pym/portage/dbapi/porttree.py5
-rw-r--r--pym/portage/dbapi/vartree.py1
3 files changed, 5 insertions, 2 deletions
diff --git a/pym/portage/dbapi/__init__.py b/pym/portage/dbapi/__init__.py
index c6318bacb..a1de0695f 100644
--- a/pym/portage/dbapi/__init__.py
+++ b/pym/portage/dbapi/__init__.py
@@ -13,6 +13,7 @@ from portage.versions import catpkgsplit, catsplit, pkgcmp
class dbapi(object):
+ _category_re = re.compile(r'^[+\w][-\.+\w]*$')
def __init__(self):
pass
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index c8e8be56c..70176c6f7 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -513,7 +513,10 @@ class portdbapi(dbapi):
self.xcache["match-all"][mycp] = cachelist
return cachelist[:]
mysplit = mycp.split("/")
- invalid_category = mysplit[0] not in self._categories
+ if self.mysettings.profile_path:
+ invalid_category = mysplit[0] not in self._categories
+ else:
+ invalid_category = not self._category_re.match(mysplit[0])
d={}
if mytree:
mytrees = [mytree]
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 3ced505f7..9c4d99277 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -165,7 +165,6 @@ class LibraryPackageMap(object):
mapfile.close()
class vardbapi(dbapi):
- _category_re = re.compile(r'^[+\w][-\.+\w]*$')
def __init__(self, root, categories=None, settings=None, vartree=None):
self.root = root[:]