mirror of
https://github.com/anchore/syft.git
synced 2026-11-03 07:56:36 +01:00
allow for RPM modularity to be optional (#2540)
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
@@ -66,7 +66,7 @@ func parseRpmDB(_ context.Context, resolver file.Resolver, env *generic.Environm
|
||||
SourceRpm: entry.SourceRpm,
|
||||
Vendor: entry.Vendor,
|
||||
Size: entry.Size,
|
||||
ModularityLabel: entry.Modularitylabel,
|
||||
ModularityLabel: &entry.Modularitylabel,
|
||||
Files: extractRpmFileRecords(resolver, *entry),
|
||||
}
|
||||
|
||||
|
||||
@@ -101,15 +101,16 @@ func TestParseRpmDB(t *testing.T) {
|
||||
pkg.NewLicenseFromLocations("MIT", packagesLocation),
|
||||
),
|
||||
Metadata: pkg.RpmDBEntry{
|
||||
Name: "dive",
|
||||
Epoch: nil,
|
||||
Arch: "x86_64",
|
||||
Release: "1",
|
||||
Version: "0.9.2",
|
||||
SourceRpm: "dive-0.9.2-1.src.rpm",
|
||||
Size: 12406784,
|
||||
Vendor: "",
|
||||
Files: []pkg.RpmFileRecord{},
|
||||
Name: "dive",
|
||||
Epoch: nil,
|
||||
Arch: "x86_64",
|
||||
Release: "1",
|
||||
Version: "0.9.2",
|
||||
SourceRpm: "dive-0.9.2-1.src.rpm",
|
||||
Size: 12406784,
|
||||
Vendor: "",
|
||||
ModularityLabel: strRef(""),
|
||||
Files: []pkg.RpmFileRecord{},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -129,14 +130,15 @@ func TestParseRpmDB(t *testing.T) {
|
||||
pkg.NewLicenseFromLocations("MIT", packagesLocation),
|
||||
),
|
||||
Metadata: pkg.RpmDBEntry{
|
||||
Name: "dive",
|
||||
Epoch: nil,
|
||||
Arch: "x86_64",
|
||||
Release: "1",
|
||||
Version: "0.9.2",
|
||||
SourceRpm: "dive-0.9.2-1.src.rpm",
|
||||
Size: 12406784,
|
||||
Vendor: "",
|
||||
Name: "dive",
|
||||
Epoch: nil,
|
||||
Arch: "x86_64",
|
||||
Release: "1",
|
||||
Version: "0.9.2",
|
||||
SourceRpm: "dive-0.9.2-1.src.rpm",
|
||||
Size: 12406784,
|
||||
Vendor: "",
|
||||
ModularityLabel: strRef(""),
|
||||
Files: []pkg.RpmFileRecord{
|
||||
{
|
||||
Path: "/usr/local/bin/dive",
|
||||
@@ -213,3 +215,7 @@ func TestToElVersion(t *testing.T) {
|
||||
func intRef(i int) *int {
|
||||
return &i
|
||||
}
|
||||
|
||||
func strRef(s string) *string {
|
||||
return &s
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user