summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-11-03 16:34:57 +0000
committerZac Medico <zmedico@gentoo.org>2007-11-03 16:34:57 +0000
commit9fb793e1bdd0ddc86574e359e4d81fa0fb578a45 (patch)
treeed3cc2bb6f501f2c73466fd768802a44c59d9f91
parent7fcf7ba7401c65fbf1de340a09c22348b700ffac (diff)
downloadportage-9fb793e1bdd0ddc86574e359e4d81fa0fb578a45.tar.gz
portage-9fb793e1bdd0ddc86574e359e4d81fa0fb578a45.tar.bz2
portage-9fb793e1bdd0ddc86574e359e4d81fa0fb578a45.zip
Bug #197932 - Make dbapi._cpv_sort_ascending()
preserve explicit -r0 for consistency in findname and aux_get calls. (trunk r8390) svn path=/main/branches/2.1.2/; revision=8391
-rw-r--r--pym/portage.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 57796e938..f6f43f4e1 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -5309,16 +5309,17 @@ class dbapi:
if len(cpv_list) > 1:
first_split = catpkgsplit(cpv_list[0])
cat = first_split[0]
- cpv_list[0] = first_split[1:]
- for i in xrange(1, len(cpv_list)):
- cpv_list[i] = catpkgsplit(cpv_list[i])[1:]
+ # If the cpv includes explicit -r0, it has to be preserved
+ # for consistency in findname and aux_get calls, so use a
+ # dict to map strings back to their original values.
+ str_map = {}
+ for i, cpv in enumerate(cpv_list):
+ mysplit = tuple(catpkgsplit(cpv)[1:])
+ str_map[mysplit] = cpv
+ cpv_list[i] = mysplit
cpv_list.sort(pkgcmp)
- for i, (pn, ver, rev) in enumerate(cpv_list):
- if rev == "r0":
- cpv = cat + "/" + pn + "-" + ver
- else:
- cpv = cat + "/" + pn + "-" + ver + "-" + rev
- cpv_list[i] = cpv
+ for i, mysplit in enumerate(cpv_list):
+ cpv_list[i] = str_map[mysplit]
def cpv_all(self):
cpv_list = []