Added the SWI Prolog (swipl) ecosystem (#3076)

* Add binary classifier for swipl

Signed-off-by: Laurent Goderre <laurent.goderre@docker.com>

* Added cataloger for SWI Prolog Pack packages

Signed-off-by: Laurent Goderre <laurent.goderre@docker.com>

---------

Signed-off-by: Laurent Goderre <laurent.goderre@docker.com>
This commit is contained in:
Laurent Goderre
2024-07-31 16:13:26 -04:00
committed by GitHub
parent a4b5dcd0df
commit 92d63df6f5
32 changed files with 2992 additions and 8 deletions
@@ -0,0 +1,39 @@
package swipl
import (
"testing"
"github.com/anchore/syft/syft/artifact"
"github.com/anchore/syft/syft/file"
"github.com/anchore/syft/syft/pkg"
"github.com/anchore/syft/syft/pkg/cataloger/internal/pkgtest"
)
func TestParsePackPackage(t *testing.T) {
fixture := "test-fixtures/pack.pl"
locations := file.NewLocationSet(file.NewLocation(fixture))
expectedPkgs := []pkg.Package{
{
Name: "hdt",
Version: "0.5.2",
PURL: "pkg:swiplpack/hdt@0.5.2",
Locations: locations,
Language: pkg.Swipl,
Type: pkg.SwiplPackPkg,
Metadata: pkg.SwiplPackEntry{
Name: "hdt",
Version: "0.5.2",
Author: "Jan Wielemaker",
AuthorEmail: "J.Wielemaker@vu.nl",
Packager: "Jan Wielemaker",
PackagerEmail: "J.Wielemaker@vu.nl",
Homepage: "https://github.com/JanWielemaker/hdt",
},
},
}
// TODO: no relationships are under test yet
var expectedRelationships []artifact.Relationship
pkgtest.TestFileParser(t, fixture, parsePackPackage, expectedPkgs, expectedRelationships)
}