summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-08-27 10:00:43 -0700
committerZac Medico <zmedico@gentoo.org>2010-08-27 10:00:43 -0700
commit51a2ae6fea30924b5668f60034922bfd9c55ea06 (patch)
tree40de5850c0824947a4b8d8ca2e75ee6126558e11
parente081b9cf09a13a420ebace67b89a0a72fe88641b (diff)
downloadportage-51a2ae6fea30924b5668f60034922bfd9c55ea06.tar.gz
portage-51a2ae6fea30924b5668f60034922bfd9c55ea06.tar.bz2
portage-51a2ae6fea30924b5668f60034922bfd9c55ea06.zip
Use cmp_sort_key() for python3 compatibility.
-rwxr-xr-xbin/egencache9
1 files changed, 4 insertions, 5 deletions
diff --git a/bin/egencache b/bin/egencache
index 1b3f98f34..7c5a8a055 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -33,9 +33,10 @@ except ImportError:
from portage import os
from _emerge.MetadataRegen import MetadataRegen
from portage.cache.cache_errors import CacheError, StatCollision
-from portage.util import writemsg_level
+from portage.util import cmp_sort_key, writemsg_level
from portage import cpv_getkey
-from portage.dep import isjustname
+from portage.dep import Atom, isjustname
+from portage.versions import pkgcmp, pkgsplit
try:
import xml.etree.ElementTree
@@ -44,8 +45,6 @@ except ImportError:
else:
from repoman.utilities import parse_metadata_use
from xml.parsers.expat import ExpatError
- from portage.dep import Atom
- from portage.versions import pkgcmp, pkgsplit
if sys.hexversion >= 0x3000000:
long = int
@@ -380,7 +379,7 @@ class GenUseLocalDesc(object):
resdict = usedict[flag]
reskeys = {_Atom(k): k for k in resdict.keys()}
- resatoms = sorted(reskeys.keys(), atomcmp)
+ resatoms = sorted(reskeys.keys(), key=cmp_sort_key(atomcmp))
resdesc = resdict[reskeys[resatoms[-1]]]
output.write('%s:%s - %s\n' % (cp, flag, resdesc))