Fix RPM DB license handling (#1184)

This commit is contained in:
Keith Zantow
2022-08-30 14:38:12 -04:00
committed by GitHub
parent ccc5a89226
commit a17ff7b555
3 changed files with 11 additions and 1 deletions
+4
View File
@@ -92,6 +92,10 @@ func newPkg(resolver source.FilePathResolver, dbLocation source.Location, entry
Metadata: metadata,
}
if entry.License != "" {
p.Licenses = append(p.Licenses, entry.License)
}
p.SetID()
return &p, nil
}
@@ -75,6 +75,7 @@ func TestParseRpmDB(t *testing.T) {
FoundBy: catalogerName,
Type: pkg.RpmPkg,
MetadataType: pkg.RpmdbMetadataType,
Licenses: []string{"MIT"},
Metadata: pkg.RpmdbMetadata{
Name: "dive",
Epoch: nil,
@@ -102,6 +103,7 @@ func TestParseRpmDB(t *testing.T) {
FoundBy: catalogerName,
Type: pkg.RpmPkg,
MetadataType: pkg.RpmdbMetadataType,
Licenses: []string{"MIT"},
Metadata: pkg.RpmdbMetadata{
Name: "dive",
Epoch: nil,