Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
rchincha committed Apr 15, 2024
1 parent 13f890e commit 1800af4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pkg/fs/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,21 @@ func checkBOM(input, pathEntry string) error {

for _, pkg := range doc.Packages {
for _, file := range pkg.Files() {
symlink, err := filepath.EvalSymlinks(file.Name)
symlink, err := filepath.EvalSymlinks(file.FileName)
if err != nil {
log.Error().Err(err).Str("path", file.Name).Str("package", pkg.Name).Msg("unable to resolve symlink")
log.Error().Err(err).Str("path", file.FileName).Str("package", pkg.Name).Msg("unable to resolve symlink")

return err
}

if file.Name != pathEntry && symlink != pathEntry {
if file.FileName != pathEntry && symlink != pathEntry {
continue
}

file.Entity.Opts = &spdx.ObjectOptions{}

if err := file.ReadSourceFile(file.Name); err != nil {
log.Error().Err(err).Str("path", file.Name).Msg("doesn't match entry in SBOM document")
if err := file.ReadSourceFile(file.FileName); err != nil {
log.Error().Err(err).Str("path", file.FileName).Msg("doesn't match entry in SBOM document")

return err
}
Expand All @@ -58,9 +58,9 @@ func checkBOM(input, pathEntry string) error {
}

for _, file := range doc.Files {
symlink, err := filepath.EvalSymlinks(file.Name)
symlink, err := filepath.EvalSymlinks(file.FileName)
if err != nil {
log.Error().Err(err).Str("path", file.Name).Msg("unable to resolve symlink")
log.Error().Err(err).Str("path", file.FileName).Msg("unable to resolve symlink")

return err
}
Expand Down

0 comments on commit 1800af4

Please sign in to comment.