fix: update erlang classifier (#4766)

Signed-off-by: witchcraze <witchcraze@gmail.com>
This commit is contained in:
witchcraze 2026-04-14 00:31:19 +09:00 committed by GitHub
parent 1e08f703d0
commit 03d6399b0c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 23 additions and 0 deletions

View File

@ -1188,6 +1188,17 @@ func Test_Cataloger_PositiveCases(t *testing.T) {
Metadata: metadata("erlang-alpine-binary"), Metadata: metadata("erlang-alpine-binary"),
}, },
}, },
{
logicalFixture: "erlang/17.5.6.9/linux-amd64",
expected: pkg.Package{
Name: "erlang",
Version: "17.5.6.9",
Type: "binary",
PURL: "pkg:generic/erlang@17.5.6.9",
Locations: locations("beam.smp"),
Metadata: metadata("erlang-alpine-binary"),
},
},
{ {
logicalFixture: "swipl/9.3.8/linux-amd64", logicalFixture: "swipl/9.3.8/linux-amd64",
expected: pkg.Package{ expected: pkg.Package{

View File

@ -374,6 +374,10 @@ func DefaultClassifiers() []binutils.Classifier {
// [NUL][NUL]26.1.2[NUL][NUL][NUL][NUL][NUL][NUL][NUL]NUL[NUL][NUL]Erlang/OTP // [NUL][NUL]26.1.2[NUL][NUL][NUL][NUL][NUL][NUL][NUL]NUL[NUL][NUL]Erlang/OTP
`\x00+(?P<version>[0-9]+\.[0-9]+(\.[0-9]+){0,2}(-rc[0-9])?)\x00+Erlang/OTP`, `\x00+(?P<version>[0-9]+\.[0-9]+(\.[0-9]+){0,2}(-rc[0-9])?)\x00+Erlang/OTP`,
), ),
m.FileContentsVersionMatcher(
// Erlang/OTP 17%s [erts-6.4.1.6] [source] [64-bit] [smp:%beu:%beu] [async-threads:%d] [hipe] [kernel-poll:%s][NUL]17.5.6.9[NUL][NUL][NUL]
`(?s)Erlang/OTP.{1,150}\x00+(?P<version>[0-9]+\.[0-9]+(\.[0-9]+){0,2}(-rc[0-9])?)\x00+`,
),
), ),
Package: "erlang", Package: "erlang",
PURL: mustPURL("pkg:generic/erlang@version"), PURL: mustPURL("pkg:generic/erlang@version"),

View File

@ -79,6 +79,14 @@ from-images:
paths: paths:
- /usr/local/lib/erlang/erts-14.1.1/bin/beam.smp - /usr/local/lib/erlang/erts-14.1.1/bin/beam.smp
- name: erlang
version: 17.5.6.9
images:
- ref: erlang:17.5.6.9@sha256:b4c39d943dfbe0351db06ac50097e4981dce4e3a01c66a1e6a19e6865e6fcb20
platform: linux/amd64
paths:
- /usr/local/lib/erlang/erts-6.4.1.6/bin/beam.smp
- version: 9.3.8 - version: 9.3.8
images: images:
- ref: swipl:9.3.8@sha256:6a15e6a03afe943228924a5502ba763e653ff28d9b3391e2b3e1fc3e991f37d4 - ref: swipl:9.3.8@sha256:6a15e6a03afe943228924a5502ba763e653ff28d9b3391e2b3e1fc3e991f37d4