From: Zac Medico Date: Mon, 14 May 2012 01:02:11 +0000 (-0700) Subject: _sets/security: use _pkg_str + vercmp, not pkgcmp X-Git-Tag: v2.2.0_alpha105~20 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2ff656151b9d7ff747660a7eed787f039cc35dfa;p=portage.git _sets/security: use _pkg_str + vercmp, not pkgcmp --- diff --git a/pym/portage/_sets/security.py b/pym/portage/_sets/security.py index 2d8fcf667..7e856bc79 100644 --- a/pym/portage/_sets/security.py +++ b/pym/portage/_sets/security.py @@ -1,9 +1,9 @@ -# Copyright 2007 Gentoo Foundation +# Copyright 2007-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import portage.glsa as glsa from portage._sets.base import PackageSet -from portage.versions import catpkgsplit, pkgcmp +from portage.versions import vercmp from portage._sets import get_boolean __all__ = ["SecuritySet", "NewGlsaSet", "NewAffectedSet", "AffectedSet"] @@ -45,12 +45,12 @@ class SecuritySet(PackageSet): for atom in atomlist[:]: cpv = self._portdbapi.xmatch("match-all", atom)[0] slot = self._portdbapi.aux_get(cpv, ["SLOT"])[0] - cps = "/".join(catpkgsplit(cpv)[0:2]) + ":" + slot + cps = "%s:%s" % (cpv.cp, slot) if not cps in mydict: mydict[cps] = (atom, cpv) else: other_cpv = mydict[cps][1] - if pkgcmp(catpkgsplit(cpv)[1:], catpkgsplit(other_cpv)[1:]) > 0: + if vercmp(cpv.version, other_cpv.version) > 0: atomlist.remove(mydict[cps][0]) mydict[cps] = (atom, cpv) return atomlist