mirror of
https://github.com/anchore/syft
synced 2024-11-10 06:14:16 +00:00
allow for RPM modularity to be optional (#2540)
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
parent
ad2843bf50
commit
bf3cd9ed3b
5 changed files with 2174 additions and 20 deletions
|
@ -3,5 +3,5 @@ package internal
|
|||
const (
|
||||
// JSONSchemaVersion is the current schema version output by the JSON encoder
|
||||
// This is roughly following the "SchemaVer" guidelines for versioning the JSON schema. Please see schema/json/README.md for details on how to increment.
|
||||
JSONSchemaVersion = "13.0.0"
|
||||
JSONSchemaVersion = "14.0.0"
|
||||
)
|
||||
|
|
2148
schema/json/schema-14.0.0.json
Normal file
2148
schema/json/schema-14.0.0.json
Normal file
File diff suppressed because it is too large
Load diff
|
@ -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
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ type RpmDBEntry struct {
|
|||
SourceRpm string `json:"sourceRpm" cyclonedx:"sourceRpm"`
|
||||
Size int `json:"size" cyclonedx:"size"`
|
||||
Vendor string `json:"vendor"`
|
||||
ModularityLabel string `json:"modularityLabel"`
|
||||
ModularityLabel *string `json:"modularityLabel,omitempty"`
|
||||
Files []RpmFileRecord `json:"files"`
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue