* [gentoo-commits] portage r14448 - main/trunk/pym/portage/dbapi
@ 2009-09-27 19:07 Zac Medico (zmedico)
0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2009-09-27 19:07 UTC (permalink / raw
To: gentoo-commits
Author: zmedico
Date: 2009-09-27 19:07:57 +0000 (Sun, 27 Sep 2009)
New Revision: 14448
Modified:
main/trunk/pym/portage/dbapi/__init__.py
Log:
Use catsplit() instead of a regex to generate dbapi._categories. Thanks to
Marat Radchenko <marat@slonopotamus.org> for this patch.
Modified: main/trunk/pym/portage/dbapi/__init__.py
===================================================================
--- main/trunk/pym/portage/dbapi/__init__.py 2009-09-27 18:30:44 UTC (rev 14447)
+++ main/trunk/pym/portage/dbapi/__init__.py 2009-09-27 19:07:57 UTC (rev 14448)
@@ -12,7 +12,7 @@
'portage.locks:unlockfile',
'portage.output:colorize',
'portage.util:cmp_sort_key,writemsg',
- 'portage.versions:catpkgsplit,vercmp',
+ 'portage.versions:catsplit,catpkgsplit,vercmp',
)
from portage import os
@@ -39,11 +39,8 @@
"""
if self._categories is not None:
return self._categories
- categories = set()
- cat_pattern = re.compile(r'(.*)/.*')
- for cp in self.cp_all():
- categories.add(cat_pattern.match(cp).group(1))
- self._categories = tuple(sorted(categories))
+ self._categories = tuple(sorted(set(catsplit(x)[0] \
+ for x in self.cp_all())))
return self._categories
def close_caches(self):
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-09-27 19:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-27 19:07 [gentoo-commits] portage r14448 - main/trunk/pym/portage/dbapi Zac Medico (zmedico)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox