diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-12-20 13:34:48 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-12-20 13:34:48 +0000 |
commit | 951e5ebb919ec07adb0ac8c9a000cbdf9048eb48 (patch) | |
tree | 74cd9ebed7abe7937c759d54588037f4a5a9c7b9 /pym/portage.py | |
parent | 9214bc41ebaefdd44edddc3368ab208ab82edb06 (diff) | |
download | portage-951e5ebb919ec07adb0ac8c9a000cbdf9048eb48.tar.gz portage-951e5ebb919ec07adb0ac8c9a000cbdf9048eb48.tar.bz2 portage-951e5ebb919ec07adb0ac8c9a000cbdf9048eb48.zip |
Fix portdbapi.cp_list() so that it can cope with a
missing profile. (trunk r8990)
svn path=/main/branches/2.1.2/; revision=8991
Diffstat (limited to 'pym/portage.py')
-rw-r--r-- | pym/portage.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pym/portage.py b/pym/portage.py index bfb330095..c9dfe0d77 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -5791,6 +5791,7 @@ class portagetree: class dbapi: + _category_re = re.compile(r'^[+\w][-\.+\w]*$') def __init__(self): pass @@ -6078,7 +6079,6 @@ class bindbapi(fakedbapi): return fakedbapi.cpv_all(self) class vardbapi(dbapi): - _category_re = re.compile(r'^[+\w][-\.+\w]*$') def __init__(self, root, categories=None, settings=None, vartree=None): self.root = root[:] #cache for category directory mtimes @@ -7192,7 +7192,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] |