From eb1f9aefed672307caa5fc1286f9a35bed3ea9f4 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 13 May 2012 18:23:53 -0700 Subject: [PATCH] glsa: use _pkg_str + vercmp, not pkgcmp --- pym/portage/glsa.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) 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): -- 2.26.2