Skip to content

Commit

Permalink
chore: rebase adjustments and conan docs updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dus7eh committed Apr 16, 2024
1 parent 1a2190c commit 89c1d14
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion docs/docs/coverage/language/c.md
Original file line number Diff line number Diff line change
Expand Up @@ -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].
Expand All @@ -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
7 changes: 3 additions & 4 deletions pkg/dependency/parser/c/conan/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ type Parser struct {
logger *log.Logger
}


func NewParser() types.Parser {
return &Parser{
logger: log.WithPrefix("conan"),
Expand Down Expand Up @@ -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
}

Expand All @@ -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)
}
}
Expand Down

0 comments on commit 89c1d14

Please sign in to comment.