mirror of
https://github.com/anchore/syft.git
synced 2026-11-02 23:46:35 +01:00
Add the Ocaml ecosystem (#3112)
Signed-off-by: Laurent Goderre <laurent.goderre@docker.com>
This commit is contained in:
@@ -26,6 +26,8 @@ func DownloadLocation(p pkg.Package) string {
|
||||
return NoneIfEmpty(metadata.Dist.URL)
|
||||
case pkg.PhpComposerInstalledEntry:
|
||||
return NoneIfEmpty(metadata.Dist.URL)
|
||||
case pkg.OpamPackage:
|
||||
return NoneIfEmpty(metadata.URL)
|
||||
}
|
||||
}
|
||||
return NOASSERTION
|
||||
|
||||
@@ -41,6 +41,7 @@ func Test_OriginatorSupplier(t *testing.T) {
|
||||
pkg.RustCargoLockEntry{},
|
||||
pkg.SwiftPackageManagerResolvedEntry{},
|
||||
pkg.SwiplPackEntry{},
|
||||
pkg.OpamPackage{},
|
||||
pkg.YarnLockEntry{},
|
||||
)
|
||||
tests := []struct {
|
||||
@@ -350,6 +351,14 @@ func Test_OriginatorSupplier(t *testing.T) {
|
||||
originator: "Person: auth (auth@auth.gov)",
|
||||
supplier: "Person: me (me@auth.com)",
|
||||
},
|
||||
{
|
||||
name: "from ocaml opam",
|
||||
input: pkg.Package{
|
||||
Metadata: pkg.OpamPackage{},
|
||||
},
|
||||
originator: "",
|
||||
supplier: "",
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
|
||||
@@ -64,6 +64,8 @@ func SourceInfo(p pkg.Package) string {
|
||||
answer = "acquired package info from resolved Swift package manifest"
|
||||
case pkg.SwiplPackPkg:
|
||||
answer = "acquired package info from SWI Prolo pack package file"
|
||||
case pkg.OpamPkg:
|
||||
answer = "acquired package info from OCaml opam package file"
|
||||
case pkg.GithubActionPkg, pkg.GithubActionWorkflowPkg:
|
||||
answer = "acquired package info from GitHub Actions workflow file or composite action file"
|
||||
case pkg.WordpressPluginPkg:
|
||||
|
||||
@@ -271,6 +271,14 @@ func Test_SourceInfo(t *testing.T) {
|
||||
"acquired package info from SWI Prolo pack package file",
|
||||
},
|
||||
},
|
||||
{
|
||||
input: pkg.Package{
|
||||
Type: pkg.OpamPkg,
|
||||
},
|
||||
expected: []string{
|
||||
"acquired package info from OCaml opam package file",
|
||||
},
|
||||
},
|
||||
{
|
||||
input: pkg.Package{
|
||||
Type: pkg.GithubActionPkg,
|
||||
|
||||
Reference in New Issue
Block a user