summaryrefslogtreecommitdiffstats
path: root/pym/portage/dbapi/porttree.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-10-28 07:26:24 +0000
committerZac Medico <zmedico@gentoo.org>2007-10-28 07:26:24 +0000
commit4ac207ffc70bb84a74d0b11d80864c5cdfa2ad32 (patch)
tree6dae73b638d9c844d6df3d20e69ca74979f28a9d /pym/portage/dbapi/porttree.py
parent2641d1772d8170f788d6ce8586b1f97a4506f04b (diff)
downloadportage-4ac207ffc70bb84a74d0b11d80864c5cdfa2ad32.tar.gz
portage-4ac207ffc70bb84a74d0b11d80864c5cdfa2ad32.tar.bz2
portage-4ac207ffc70bb84a74d0b11d80864c5cdfa2ad32.zip
Sort all dbapi.cp_list() results in ascending order and
cache the results when possible. The order is preserved in dbapi.match() so those results are also sorted. svn path=/main/trunk/; revision=8329
Diffstat (limited to 'pym/portage/dbapi/porttree.py')
-rw-r--r--pym/portage/dbapi/porttree.py12
1 files changed, 1 insertions, 11 deletions
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index 4f9b1cbbe..84f8c196d 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -528,17 +528,7 @@ class portdbapi(dbapi):
mylist = d.keys()
# Always sort in ascending order here since it's handy
# and the result can be easily cached and reused.
- if len(mylist) > 1:
- for i in xrange(len(mylist)):
- mylist[i] = catpkgsplit(mylist[i])[1:]
- mylist.sort(pkgcmp)
- cat = mysplit[0]
- for i, (pn, ver, rev) in enumerate(mylist):
- if rev == "r0":
- cpv = cat + "/" + pn + "-" + ver
- else:
- cpv = cat + "/" + pn + "-" + ver + "-" + rev
- mylist[i] = cpv
+ self._cpv_sort_ascending(mylist)
if self.frozen and mytree is None:
cachelist = mylist[:]
self.xcache["cp-list"][mycp] = cachelist