mirror of
https://github.com/anchore/syft.git
synced 2025-11-18 17:03:17 +01:00
feat: binary classifier for GCC (#2479)
Signed-off-by: Laurent Goderre <laurent.goderre@docker.com>
This commit is contained in:
parent
85cc64f7e3
commit
e61aac0b53
@ -805,6 +805,17 @@ func Test_Cataloger_PositiveCases(t *testing.T) {
|
||||
Metadata: metadata("openssl-binary"),
|
||||
},
|
||||
},
|
||||
{
|
||||
logicalFixture: "gcc/12.3.0/linux-amd64",
|
||||
expected: pkg.Package{
|
||||
Name: "gcc",
|
||||
Version: "12.3.0",
|
||||
Type: "binary",
|
||||
PURL: "pkg:generic/gcc@12.3.0",
|
||||
Locations: locations("gcc"),
|
||||
Metadata: metadata("gcc-binary"),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
|
||||
@ -350,6 +350,17 @@ func DefaultClassifiers() []Classifier {
|
||||
PURL: mustPURL("pkg:generic/openssl@version"),
|
||||
CPEs: singleCPE("cpe:2.3:a:openssl:openssl:*:*:*:*:*:*:*:*"),
|
||||
},
|
||||
{
|
||||
Class: "gcc-binary",
|
||||
FileGlob: "**/gcc",
|
||||
EvidenceMatcher: FileContentsVersionMatcher(
|
||||
// GCC: \(GNU\) 12.3.0'
|
||||
`GCC: \(GNU\) (?P<version>[0-9]+\.[0-9]+\.[0-9]+)`,
|
||||
),
|
||||
Package: "gcc",
|
||||
PURL: mustPURL("pkg:generic/gcc@version"),
|
||||
CPEs: singleCPE("cpe:2.3:a:gnu:gcc:*:*:*:*:*:*:*:*"),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
@ -24,6 +24,13 @@ from-images:
|
||||
paths:
|
||||
- /usr/local/bin/bash
|
||||
|
||||
- version: 12.3.0
|
||||
images:
|
||||
- ref: gcc:12.3.0-bookworm@sha256:2e3c00752fa23a0993b6618760bbc20263b272a0b34b2d4883159e3ebba9d8b6
|
||||
platform: linux/amd64
|
||||
paths:
|
||||
- /usr/local/bin/gcc
|
||||
|
||||
- version: 25.3.2.6
|
||||
images:
|
||||
- ref: erlang:25.3.2.6@sha256:0d1e530ec0e8047094f0a1d841754515bad9b0554260a3147fb34df31b3064fe
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user