summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-12-20 13:34:29 +0000
committerZac Medico <zmedico@gentoo.org>2007-12-20 13:34:29 +0000
commitde97d4dd76f4e1039a648bd092443cf41d363c3f (patch)
tree47b6fba044d6df1f75b7cda6d5a8ceb614c1366a /pym
parentf5cff23564a9b30cf9d867a155969cb6e65577ad (diff)
downloadportage-de97d4dd76f4e1039a648bd092443cf41d363c3f.tar.gz
portage-de97d4dd76f4e1039a648bd092443cf41d363c3f.tar.bz2
portage-de97d4dd76f4e1039a648bd092443cf41d363c3f.zip
Fix portdbapi.cp_list() so that it can cope with a
missing profile. svn path=/main/trunk/; revision=8990
Diffstat (limited to 'pym')
-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[:]