diff options
Diffstat (limited to 'pym')
-rw-r--r-- | pym/portage/glsa.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/pym/portage/glsa.py b/pym/portage/glsa.py index 514dcc044..76eae2b69 100644 --- a/pym/portage/glsa.py +++ b/pym/portage/glsa.py @@ -342,8 +342,9 @@ def getMinUpgrade(vulnerableList, unaffectedList, portdbapi, vardbapi, minimize= I{vulnerableList} and returns string describing the lowest version for the package that matches an atom in I{unaffectedList} and is greater than the currently installed - version or None if the system is not affected. Both - I{vulnerableList} and I{unaffectedList} should have the + version. It will return an empty list if the system is affected, + and no upgrade is possible or None if the system is not affected. + Both I{vulnerableList} and I{unaffectedList} should have the same base package. @type vulnerableList: List of Strings @@ -361,7 +362,7 @@ def getMinUpgrade(vulnerableList, unaffectedList, portdbapi, vardbapi, minimize= @return: the lowest unaffected version that is greater than the installed version. """ - rValue = None + rValue = "" v_installed = reduce(operator.add, [match(v, vardbapi) for v in vulnerableList], []) u_installed = reduce(operator.add, [match(u, vardbapi) for u in unaffectedList], []) @@ -371,14 +372,14 @@ def getMinUpgrade(vulnerableList, unaffectedList, portdbapi, vardbapi, minimize= install_unaffected = False if install_unaffected: - return rValue - + return None + for u in unaffectedList: mylist = match(u, portdbapi, match_type="match-all") for c in mylist: i = best(v_installed) if vercmp(c.version, i.version) > 0 \ - and (rValue == None \ + and (rValue == "" \ or not match("="+rValue, portdbapi) \ or (minimize ^ (vercmp(c.version, rValue.version) > 0)) \ and match("="+c, portdbapi)) \ @@ -646,7 +647,7 @@ class Glsa: for v in path["vul_atoms"]: rValue = rValue \ or (len(match(v, self.vardbapi)) > 0 \ - and getMinUpgrade(path["vul_atoms"], path["unaff_atoms"], \ + and None != getMinUpgrade(path["vul_atoms"], path["unaff_atoms"], \ self.portdbapi, self.vardbapi)) return rValue |