diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-12-20 13:34:29 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-12-20 13:34:29 +0000 |
commit | de97d4dd76f4e1039a648bd092443cf41d363c3f (patch) | |
tree | 47b6fba044d6df1f75b7cda6d5a8ceb614c1366a | |
parent | f5cff23564a9b30cf9d867a155969cb6e65577ad (diff) | |
download | portage-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
-rw-r--r-- | pym/portage/dbapi/__init__.py | 1 | ||||
-rw-r--r-- | pym/portage/dbapi/porttree.py | 5 | ||||
-rw-r--r-- | pym/portage/dbapi/vartree.py | 1 |
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[:] |