From 951e5ebb919ec07adb0ac8c9a000cbdf9048eb48 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 20 Dec 2007 13:34:48 +0000 Subject: Fix portdbapi.cp_list() so that it can cope with a missing profile. (trunk r8990) svn path=/main/branches/2.1.2/; revision=8991 --- pym/portage.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'pym') 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] -- cgit v1.2.3-1-g7c22