mirror of
https://github.com/anchore/syft.git
synced 2026-11-05 00:46:38 +01:00
Add RPM file scanning support (#1188)
This commit is contained in:
@@ -89,7 +89,7 @@ func candidateVendors(p pkg.Package) []string {
|
||||
}
|
||||
|
||||
switch p.MetadataType {
|
||||
case pkg.RpmdbMetadataType:
|
||||
case pkg.RpmMetadataType:
|
||||
vendors.union(candidateVendorsForRPM(p))
|
||||
case pkg.GemMetadataType:
|
||||
vendors.union(candidateVendorsForRuby(p))
|
||||
|
||||
@@ -316,8 +316,8 @@ func TestGeneratePackageCPEs(t *testing.T) {
|
||||
Version: "3.2",
|
||||
FoundBy: "some-analyzer",
|
||||
Type: pkg.RpmPkg,
|
||||
MetadataType: pkg.RpmdbMetadataType,
|
||||
Metadata: pkg.RpmdbMetadata{
|
||||
MetadataType: pkg.RpmMetadataType,
|
||||
Metadata: pkg.RpmMetadata{
|
||||
Vendor: "some-vendor",
|
||||
},
|
||||
},
|
||||
@@ -334,8 +334,8 @@ func TestGeneratePackageCPEs(t *testing.T) {
|
||||
Version: "1:3.2",
|
||||
FoundBy: "some-analyzer",
|
||||
Type: pkg.RpmPkg,
|
||||
MetadataType: pkg.RpmdbMetadataType,
|
||||
Metadata: pkg.RpmdbMetadata{
|
||||
MetadataType: pkg.RpmMetadataType,
|
||||
Metadata: pkg.RpmMetadata{
|
||||
Vendor: "some-vendor",
|
||||
},
|
||||
},
|
||||
|
||||
@@ -3,7 +3,7 @@ package cpe
|
||||
import "github.com/anchore/syft/syft/pkg"
|
||||
|
||||
func candidateVendorsForRPM(p pkg.Package) fieldCandidateSet {
|
||||
metadata, ok := p.Metadata.(pkg.RpmdbMetadata)
|
||||
metadata, ok := p.Metadata.(pkg.RpmMetadata)
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user