From: Zac Medico Date: Mon, 14 May 2012 01:23:53 +0000 (-0700) Subject: glsa: use _pkg_str + vercmp, not pkgcmp X-Git-Tag: v2.2.0_alpha105~19 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=eb1f9aefed672307caa5fc1286f9a35bed3ea9f4;p=portage.git glsa: use _pkg_str + vercmp, not pkgcmp --- diff --git a/pym/portage/glsa.py b/pym/portage/glsa.py index 16f662f0d..0e590688e 100644 --- a/pym/portage/glsa.py +++ b/pym/portage/glsa.py @@ -13,7 +13,7 @@ from portage import os from portage import _encodings from portage import _unicode_decode from portage import _unicode_encode -from portage.versions import pkgsplit, catpkgsplit, pkgcmp, best +from portage.versions import pkgsplit, vercmp, best from portage.util import grabfile, urlopen from portage.const import CACHE_PATH from portage.localization import _ @@ -368,17 +368,14 @@ def getMinUpgrade(vulnerableList, unaffectedList, portdbapi, vardbapi, minimize= for u in unaffectedList: mylist = match(u, portdbapi, match_type="match-all") for c in mylist: - c_pv = catpkgsplit(c) - i_pv = catpkgsplit(best(v_installed)) - if pkgcmp(c_pv[1:], i_pv[1:]) > 0 \ + i = best(v_installed) + if vercmp(c.version, i.version) > 0 \ and (rValue == None \ or not match("="+rValue, portdbapi) \ - or (minimize ^ (pkgcmp(c_pv[1:], catpkgsplit(rValue)[1:]) > 0)) \ + or (minimize ^ (vercmp(c.version, rValue.version) > 0)) \ and match("="+c, portdbapi)) \ and portdbapi.aux_get(c, ["SLOT"]) == vardbapi.aux_get(best(v_installed), ["SLOT"]): - rValue = c_pv[0]+"/"+c_pv[1]+"-"+c_pv[2] - if c_pv[3] != "r0": # we don't like -r0 for display - rValue += "-"+c_pv[3] + rValue = c return rValue def format_date(datestr):