mirror of
https://github.com/anchore/syft.git
synced 2026-08-19 16:48:27 +02:00
fix(binary): detect Deno 1.11 and 2.9 versions
Signed-off-by: ychampion <ychampion@users.noreply.github.com> Co-authored-by: ychampion <ychampion@users.noreply.github.com>
This commit is contained in:
parent
16223e6dd7
commit
476ce60768
@ -1499,6 +1499,28 @@ func Test_Cataloger_PositiveCases(t *testing.T) {
|
||||
Metadata: metadata("deno-binary"),
|
||||
},
|
||||
},
|
||||
{
|
||||
logicalFixture: "deno/1.11.3/linux-amd64",
|
||||
expected: pkg.Package{
|
||||
Name: "deno",
|
||||
Version: "1.11.3",
|
||||
Type: "binary",
|
||||
PURL: "pkg:generic/deno@1.11.3",
|
||||
Locations: locations("deno"),
|
||||
Metadata: metadata("deno-binary"),
|
||||
},
|
||||
},
|
||||
{
|
||||
logicalFixture: "deno/1.11.4/linux-amd64",
|
||||
expected: pkg.Package{
|
||||
Name: "deno",
|
||||
Version: "1.11.4",
|
||||
Type: "binary",
|
||||
PURL: "pkg:generic/deno@1.11.4",
|
||||
Locations: locations("deno"),
|
||||
Metadata: metadata("deno-binary"),
|
||||
},
|
||||
},
|
||||
{
|
||||
logicalFixture: "deno/1.16.4/linux-amd64",
|
||||
expected: pkg.Package{
|
||||
@ -1565,6 +1587,17 @@ func Test_Cataloger_PositiveCases(t *testing.T) {
|
||||
Metadata: metadata("deno-binary"),
|
||||
},
|
||||
},
|
||||
{
|
||||
logicalFixture: "deno/2.9.2/linux-amd64",
|
||||
expected: pkg.Package{
|
||||
Name: "deno",
|
||||
Version: "2.9.2",
|
||||
Type: "binary",
|
||||
PURL: "pkg:generic/deno@2.9.2",
|
||||
Locations: locations("deno"),
|
||||
Metadata: metadata("deno-binary"),
|
||||
},
|
||||
},
|
||||
{
|
||||
logicalFixture: "bun/0.5.9/linux-amd64",
|
||||
expected: pkg.Package{
|
||||
|
||||
@ -588,11 +588,20 @@ func DefaultClassifiers() []binutils.Classifier {
|
||||
Class: "deno-binary",
|
||||
FileGlob: "**/deno",
|
||||
EvidenceMatcher: binutils.MatchAny(
|
||||
m.FileContentsVersionMatcher(
|
||||
// Deno/2.6.3Deno/
|
||||
// Deno/1.41.0cli/
|
||||
`Deno/(?P<version>[0-9]+\.[0-9]+\.[0-9]+)(Deno/|cli/)`,
|
||||
),
|
||||
m.FileContentsVersionMatcher(
|
||||
// Deno/2.6.3
|
||||
// Deno/1.41.0
|
||||
`Deno/(?P<version>[0-9]+\.[0-9]+\.[0-9]+)`,
|
||||
),
|
||||
m.FileContentsVersionMatcher(
|
||||
// cli/tools/standalone.rsdeno-canary/f4bed1081456089559c82441a13c4fb700840cac1.11.3dlwindows
|
||||
`deno-canary/[0-9a-z]{40}(?P<version>[0-9]+\.[0-9]+\.[0-9]+)`,
|
||||
),
|
||||
m.FileContentsVersionMatcher(
|
||||
// deno::tools::standalonedeno-65db94feba9d4d51a09b74629f566dbc90484fbarelease/v1.29.4windows
|
||||
// cli/tools/standalone.rsdeno-74064c9d8c222b33b2a552ea0af1054f57002a96release/v1.28.3windows
|
||||
|
||||
9
syft/pkg/cataloger/binary/testdata/classifiers/snippets/deno/1.11.3/linux-amd64/deno
vendored
Normal file
9
syft/pkg/cataloger/binary/testdata/classifiers/snippets/deno/1.11.3/linux-amd64/deno
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
name: deno
|
||||
offset: 4221667
|
||||
length: 120
|
||||
snippetSha256: 89509d15b73fd2d901b20ebfe82c67fd27f70e7b01dcbf376e7e80e6c80f97d9
|
||||
fileSha256: 530a95c93ddfa41bd4d72d665e677d5af9a4275f1520e638305e60af5083a6d6
|
||||
|
||||
### byte snippet to follow ###
|
||||
g ctrl+d or close()
|
||||
Error: Uncaught cli/tools/standalone.rsdeno-canary/f4bed1081456089559c82441a13c4fb700840cac1.11.3dlw
|
||||
9
syft/pkg/cataloger/binary/testdata/classifiers/snippets/deno/1.11.4/linux-amd64/deno
vendored
Normal file
9
syft/pkg/cataloger/binary/testdata/classifiers/snippets/deno/1.11.4/linux-amd64/deno
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
name: deno
|
||||
offset: 4225763
|
||||
length: 120
|
||||
snippetSha256: b47e8cf36bdf93e4bc63a2d7bd0a5d759975f12751a66908661777eba7e90025
|
||||
fileSha256: 1a55c23bb0b666d1b26d9d16f3a9d27210b6b13421031f7f18ff18abfcb8664f
|
||||
|
||||
### byte snippet to follow ###
|
||||
g ctrl+d or close()
|
||||
Error: Uncaught cli/tools/standalone.rsdeno-canary/ed16f4332263e81bf00a39ebc2200291b1fcbb8e1.11.4dlw
|
||||
BIN
syft/pkg/cataloger/binary/testdata/classifiers/snippets/deno/2.9.2/linux-amd64/deno
vendored
Normal file
BIN
syft/pkg/cataloger/binary/testdata/classifiers/snippets/deno/2.9.2/linux-amd64/deno
vendored
Normal file
Binary file not shown.
24
syft/pkg/cataloger/binary/testdata/config.yaml
vendored
24
syft/pkg/cataloger/binary/testdata/config.yaml
vendored
@ -140,6 +140,22 @@ from-images:
|
||||
paths:
|
||||
- /usr/bin/deno
|
||||
|
||||
- name: deno
|
||||
version: 1.11.3
|
||||
images:
|
||||
- ref: denoland/deno:1.11.3@sha256:340d071dc71c8403c75713694db04f59b8cb7f6c7244798cd7447d55f2750596
|
||||
platform: linux/amd64
|
||||
paths:
|
||||
- /usr/bin/deno
|
||||
|
||||
- name: deno
|
||||
version: 1.11.4
|
||||
images:
|
||||
- ref: denoland/deno:1.11.4@sha256:8e9a449a50b71c779ad1c10ec79055b20a331e78a3852818fac47bc3e85b49f4
|
||||
platform: linux/amd64
|
||||
paths:
|
||||
- /usr/bin/deno
|
||||
|
||||
- name: deno
|
||||
version: 1.16.4
|
||||
images:
|
||||
@ -188,6 +204,14 @@ from-images:
|
||||
paths:
|
||||
- /usr/bin/deno
|
||||
|
||||
- name: deno
|
||||
version: 2.9.2
|
||||
images:
|
||||
- ref: denoland/deno:ubuntu-2.9.2@sha256:0d27941f871700ebd95953c36fb1a817135c20f5afe3a645935672dfab72b2e9
|
||||
platform: linux/amd64
|
||||
paths:
|
||||
- /usr/bin/deno
|
||||
|
||||
# haskell:7.10.3 detail information is missing.
|
||||
- name: haskell-ghc
|
||||
version: 7.10.3
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user