Fix(reporting): NotFixedYet of SourcePackage in OVAL match on Debian and Ubuntu (#656)

* fix(refactoring): oval

* Fix(reporting): NotFixedYet of SourcePackage in OVAL match on Debian and Ubuntu #655
This commit is contained in:
Kota Kanbe
2018-05-22 18:53:08 +09:00
committed by GitHub
parent 9cc78770a3
commit 09779962cf
8 changed files with 89 additions and 10 deletions

View File

@@ -187,3 +187,15 @@ func (s *SrcPackage) AddBinaryName(name string) {
// SrcPackages is Map of SrcPackage
// { "package-name": SrcPackage }
type SrcPackages map[string]SrcPackage
// FindByBinName finds by bin-package-name
func (s SrcPackages) FindByBinName(name string) (*SrcPackage, bool) {
for _, p := range s {
for _, binName := range p.BinaryNames {
if binName == name {
return &p, true
}
}
}
return nil, false
}