mirror of
https://github.com/anchore/syft.git
synced 2026-11-02 23:46:35 +01:00
feat: update licenses to including license content when SPDX expressions are unable to be determined (#3366)
--------- Signed-off-by: HeyeOpenSource <opensource@heye-international.com> Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com> Co-authored-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
This commit is contained in:
co-authored by
Christopher Phillips
parent
58dc43de86
commit
f7e767fc25
@@ -51,6 +51,7 @@ type License struct {
|
||||
Type license.Type `json:"type"`
|
||||
URLs []string `json:"urls"`
|
||||
Locations []file.Location `json:"locations"`
|
||||
Contents string `json:"contents,omitempty"`
|
||||
}
|
||||
|
||||
func newModelLicensesFromValues(licenses []string) (ml []License) {
|
||||
|
||||
@@ -234,6 +234,7 @@ func toLicenseModel(pkgLicenses []pkg.License) (modelLicenses []model.License) {
|
||||
Type: l.Type,
|
||||
URLs: urls,
|
||||
Locations: locations,
|
||||
Contents: l.Contents,
|
||||
})
|
||||
}
|
||||
return
|
||||
|
||||
@@ -164,6 +164,7 @@ func toSyftLicenses(m []model.License) (p []pkg.License) {
|
||||
Type: l.Type,
|
||||
URLs: l.URLs,
|
||||
Locations: file.NewLocationSet(l.Locations...),
|
||||
Contents: l.Contents,
|
||||
})
|
||||
}
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user