Skip to content

Commit

Permalink
chore: rebase adjustments and conan docs updates
Browse files Browse the repository at this point in the history
Update docs/docs/coverage/language/c.md

Co-authored-by: Teppei Fukuda <[email protected]>
  • Loading branch information
dus7eh and knqyf263 committed Apr 25, 2024
1 parent a4c2085 commit 3fb527e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 4 additions & 3 deletions docs/docs/coverage/language/c.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ The following scanners are supported.

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] |[^3] | Excluded |||
| Package manager | File | Transitive dependencies | Dev dependencies | [Dependency graph][dependency-graph] | Position |
|-----------------------|----------------|:-----------------------:|:----------------:|:------------------------------------:|:--------:|
| Conan (lockfile v1) | conan.lock[^2] || Excluded |||
| Conan (lockfile v2) | conan.lock[^2] |[^3] | Excluded | - ||

## Conan
In order to detect dependencies, Trivy searches for `conan.lock`[^1].
Expand Down
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 3fb527e

Please sign in to comment.