Skip to content

Commit

Permalink
Add Rakudo Star binaries cataloger
Browse files Browse the repository at this point in the history
  • Loading branch information
gdams committed Sep 12, 2024
1 parent fcd5ec9 commit dd70430
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
12 changes: 11 additions & 1 deletion syft/pkg/cataloger/binary/classifier_cataloger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,17 @@ func Test_Cataloger_PositiveCases(t *testing.T) {
Metadata: metadata("helm"),
},
},

{
logicalFixture: "rakudo-star/2024.08/linux-amd64",
expected: pkg.Package{
Name: "rakudo/star",
Version: "2024.08",
Type: "binary",
PURL: "pkg:generic/rakudo/star@2024.08",
Locations: locations("rakudo-2024.08"),
Metadata: metadata("rakudo-star-binary"),
},
},
{
// note: dynamic (non-snippet) test case
logicalFixture: "redis-server/2.8.23/linux-amd64",
Expand Down
10 changes: 10 additions & 0 deletions syft/pkg/cataloger/binary/classifiers.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,16 @@ func DefaultClassifiers() []Classifier {
PURL: mustPURL("pkg:generic/mariadb@version"),
CPEs: singleCPE("cpe:2.3:a:mariadb:mariadb:*:*:*:*:*:*:*:*", cpe.NVDDictionaryLookupSource),
},
{
Class: "rakudo-star-binary",
FileGlob: "**/rakudo*",
EvidenceMatcher: FileContentsVersionMatcher(
`(?m)Rakudo version\s*(?P<version>[0-9]+\.[0-9]+\.[0-9]+)`,
),
Package: "rakudo/star",
PURL: mustPURL("pkg:generic/rakudo/star@version"),
CPEs: singleCPE("cpe:2.3:a:rakudo:star:*:*:*:*:*:*:*:*"),
},
{
Class: "rust-standard-library-linux",
FileGlob: "**/libstd-????????????????.so",
Expand Down
Binary file not shown.
16 changes: 16 additions & 0 deletions syft/pkg/cataloger/binary/test-fixtures/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,22 @@ from-images:
paths:
- /opt/pypy/bin/libpypy3.9-c.so

- name: rakudo-star
version: 2024.08
images:
- ref: rakudo-star:2024.08-bookworm@sha256:fb46bca51e03649ee14c3b1de3ecf8b4bb096e43
platform: linux/amd64
paths:
- /usr/bin/rakudo

- name: rakudo-star
version: 2024.08-alpine
images:
- ref: rakudo-star:2024.08-alpine@sha256:fb46bca51e03649ee14c3b1de3ecf8b4bb096e43
platform: linux/amd64
paths:
- /usr/local/bin/rakudo

- version: 2.8.23
images:
- ref: redis:2.8.23@sha256:e507029ca6a11b85f8628ff16d7ff73ae54582f16fd757e64431f5ca6d27a13c
Expand Down

0 comments on commit dd70430

Please sign in to comment.