--- /usr/lib/gentoolkit/pym/glsa.py 2006-01-09 12:44:23.000000000 -0600 +++ ./glsa.py 2006-01-12 14:05:29.000000000 -0600 @@ -614,3 +614,25 @@ if update: rValue.append(update) return rValue + + def getVulnerablePackages(self, pkg): + """ + Returns the list of installed vulnerable packages. + + @type pkg: String + @param pkg: Name of vulnerable package + + @rtype: List of Strings + @return: list of installed vulnerable package versions + """ + + rValue = [] + pkg = portage.dep_getkey(pkg) + for path in self.packages[pkg]: + for atom in path["vul_atoms"]: + pkglist = portage.db["/"]["vartree"].dbapi.match(atom) + if pkglist: + for x in pkglist: + rValue.append(x) + + return rValue