mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01:00
feat: add postgresql classifier (#1536)
* add postgresql classifier Signed-off-by: witchcraze <witchcraze@gmail.com> * revert package dedup test upgrade Signed-off-by: Alex Goodman <alex.goodman@anchore.com> --------- Signed-off-by: Alex Goodman <alex.goodman@anchore.com> Co-authored-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
parent
8847ba5d0b
commit
284814153d
@ -19,6 +19,62 @@ func TestClassifierCataloger_DefaultClassifiers_PositiveCases(t *testing.T) {
|
|||||||
fixtureDir string
|
fixtureDir string
|
||||||
expected pkg.Package
|
expected pkg.Package
|
||||||
}{
|
}{
|
||||||
|
{
|
||||||
|
name: "positive-postgresql-15beta4",
|
||||||
|
fixtureDir: "test-fixtures/classifiers/positive/postgresql-15beta4",
|
||||||
|
expected: pkg.Package{
|
||||||
|
Name: "postgresql",
|
||||||
|
Version: "15beta4",
|
||||||
|
Type: "binary",
|
||||||
|
PURL: "pkg:generic/postgresql@15beta4",
|
||||||
|
Locations: singleLocation("postgres"),
|
||||||
|
Metadata: pkg.BinaryMetadata{
|
||||||
|
Classifier: "postgresql-binary",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "positive-postgresql-15.1",
|
||||||
|
fixtureDir: "test-fixtures/classifiers/positive/postgresql-15.1",
|
||||||
|
expected: pkg.Package{
|
||||||
|
Name: "postgresql",
|
||||||
|
Version: "15.1",
|
||||||
|
Type: "binary",
|
||||||
|
PURL: "pkg:generic/postgresql@15.1",
|
||||||
|
Locations: singleLocation("postgres"),
|
||||||
|
Metadata: pkg.BinaryMetadata{
|
||||||
|
Classifier: "postgresql-binary",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "positive-postgresql-9.6.24",
|
||||||
|
fixtureDir: "test-fixtures/classifiers/positive/postgresql-9.6.24",
|
||||||
|
expected: pkg.Package{
|
||||||
|
Name: "postgresql",
|
||||||
|
Version: "9.6.24",
|
||||||
|
Type: "binary",
|
||||||
|
PURL: "pkg:generic/postgresql@9.6.24",
|
||||||
|
Locations: singleLocation("postgres"),
|
||||||
|
Metadata: pkg.BinaryMetadata{
|
||||||
|
Classifier: "postgresql-binary",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "positive-postgresql-9.5alpha1",
|
||||||
|
fixtureDir: "test-fixtures/classifiers/positive/postgresql-9.5alpha1",
|
||||||
|
expected: pkg.Package{
|
||||||
|
Name: "postgresql",
|
||||||
|
Version: "9.5alpha1",
|
||||||
|
Type: "binary",
|
||||||
|
PURL: "pkg:generic/postgresql@9.5alpha1",
|
||||||
|
Locations: singleLocation("postgres"),
|
||||||
|
Metadata: pkg.BinaryMetadata{
|
||||||
|
Classifier: "postgresql-binary",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "positive-traefik-2.9.6",
|
name: "positive-traefik-2.9.6",
|
||||||
fixtureDir: "test-fixtures/classifiers/positive/traefik-2.9.6",
|
fixtureDir: "test-fixtures/classifiers/positive/traefik-2.9.6",
|
||||||
|
|||||||
@ -175,4 +175,16 @@ var defaultClassifiers = []classifier{
|
|||||||
Package: "traefik",
|
Package: "traefik",
|
||||||
PURL: mustPURL("pkg:generic/traefik@version"),
|
PURL: mustPURL("pkg:generic/traefik@version"),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Class: "postgresql-binary",
|
||||||
|
FileGlob: "**/postgres",
|
||||||
|
EvidenceMatcher: fileContentsVersionMatcher(
|
||||||
|
// [NUL]PostgreSQL 15beta4
|
||||||
|
// [NUL]PostgreSQL 15.1
|
||||||
|
// [NUL]PostgreSQL 9.6.24
|
||||||
|
// ?PostgreSQL 9.5alpha1
|
||||||
|
`(?m)(\x00|\?)PostgreSQL (?P<version>[0-9]+(\.[0-9]+)?(\.[0-9]+)?(alpha[0-9]|beta[0-9]|rc[0-9])?)`),
|
||||||
|
Package: "postgresql",
|
||||||
|
PURL: mustPURL("pkg:generic/postgresql@version"),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@ -0,0 +1,5 @@
|
|||||||
|
byteaout
|
||||||
|
byteain
|
||||||
|
?PostgreSQL 9.5alpha1 on x86_64-unknown-linux-gnu, compiled by gcc (Debian 4.9.2-10) 4.9.2, 64-bit
|
||||||
|
/tmp/buildd/postgresql-9.5-9.5~alpha1/build/../src/backend/utils/adt/windowfuncs.c
|
||||||
|
argument of ntile must be greater than zero
|
||||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user