From 89c1d149d6cedae495857cdf1ad5ba45535f1b97 Mon Sep 17 00:00:00 2001 From: Damian Ellwart Date: Wed, 17 Apr 2024 00:02:40 +0200 Subject: [PATCH] chore: rebase adjustments and conan docs updates --- docs/docs/coverage/language/c.md | 3 ++- pkg/dependency/parser/c/conan/parse.go | 7 +++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/docs/coverage/language/c.md b/docs/docs/coverage/language/c.md index a54ecceba699..1e8b290b51ce 100644 --- a/docs/docs/coverage/language/c.md +++ b/docs/docs/coverage/language/c.md @@ -12,7 +12,7 @@ The following table provides an outline of the features Trivy offers. | Package manager | File | Transitive dependencies | Dev dependencies | [Dependency graph][dependency-graph] | Position | | --------------- | -------------- | :---------------------: | :--------------: | :----------------------------------: | :------: | -| Conan | conan.lock[^1] | ✓ [^2] | Excluded | ✓ | ✓ | +| Conan | conan.lock[^1] | ✓ [^2] | Excluded | ✓ [^3] | ✓ | ## Conan In order to detect dependencies, Trivy searches for `conan.lock`[^1]. @@ -23,3 +23,4 @@ In order to detect dependencies, Trivy searches for `conan.lock`[^1]. [^1]: `conan.lock` is default name. To scan a custom filename use [file-patterns](../../configuration/skipping.md#file-patterns) [^2]: For `conan.lock` in version 2, indirect dependencies are included in analysis but not flagged explicitly in dependency tree +[^3]: Dependency graph is supported for conan lockfiles in v1.x diff --git a/pkg/dependency/parser/c/conan/parse.go b/pkg/dependency/parser/c/conan/parse.go index 6f5c973d9a02..715ecb6c1dc0 100644 --- a/pkg/dependency/parser/c/conan/parse.go +++ b/pkg/dependency/parser/c/conan/parse.go @@ -43,7 +43,6 @@ type Parser struct { logger *log.Logger } - func NewParser() types.Parser { return &Parser{ logger: log.WithPrefix("conan"), @@ -108,7 +107,7 @@ func (p *Parser) parseV2(lock LockFile) ([]types.Library, []types.Dependency, er for _, req := range lock.Requires { lib, err := toLibrary(req.Dependency, req.StartLine, req.EndLine) if err != nil { - log.Logger.Debug(err) + p.logger.Debug("Creating library entry from requirement failed", err) continue } @@ -130,11 +129,11 @@ func (p *Parser) Parse(r xio.ReadSeekerAt) ([]types.Library, []types.Dependency, // try to parse requirements as conan v1.x if lock.GraphLock.Nodes != nil { - log.Logger.Debug("Handling conan lockfile as v1.x") + p.logger.Debug("Handling conan lockfile as v1.x") return p.parseV1(lock) } else { // try to parse requirements as conan v2.x - log.Logger.Debug("Handling conan lockfile as v2.x") + p.logger.Debug("Handling conan lockfile as v2.x") return p.parseV2(lock) } }