feat: binary classifier for pypy (#2474)

Signed-off-by: Laurent Goderre <laurent.goderre@docker.com>
This commit is contained in:
Laurent Goderre 2024-01-10 10:59:25 -05:00 committed by GitHub
parent c209d03fe8
commit d1e4ecba42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 0 deletions

View file

@ -513,6 +513,16 @@ func Test_Cataloger_PositiveCases(t *testing.T) {
},
},
},
{
logicalFixture: "pypy-shared-lib/7.3.14/linux-amd64",
expected: pkg.Package{
Name: "pypy",
Version: "7.3.14",
PURL: "pkg:generic/pypy@7.3.14",
Locations: locations("libpypy3.9-c.so"),
Metadata: metadata("pypy-binary-lib"),
},
},
{
logicalFixture: "go/1.21.3/linux-amd64",
expected: pkg.Package{

View file

@ -38,6 +38,14 @@ func DefaultClassifiers() []Classifier {
cpe.Must("cpe:2.3:a:python:python:*:*:*:*:*:*:*:*"),
},
},
{
Class: "pypy-binary-lib",
FileGlob: "**/libpypy*.so*",
EvidenceMatcher: FileContentsVersionMatcher(
`(?m)\[PyPy (?P<version>[0-9]+\.[0-9]+\.[0-9]+)`),
Package: "pypy",
PURL: mustPURL("pkg:generic/pypy@version"),
},
{
Class: "go-binary",
FileGlob: "**/go",

View file

@ -232,6 +232,14 @@ from-images:
paths:
- /usr/local/lib/libpython3.7m.so.1.0
- name: pypy-shared-lib
version: 7.3.14
images:
- ref: pypy:3.9-7.3.14-slim-bullseye@sha256:058f1a0c073534e535aed3d45c1982648378167901a05a0f35056006bf2e13bc
platform: linux/amd64
paths:
- /opt/pypy/bin/libpypy3.9-c.so
- version: 2.8.23
images:
- ref: redis:2.8.23@sha256:e507029ca6a11b85f8628ff16d7ff73ae54582f16fd757e64431f5ca6d27a13c