■ ■ ■ ■ ■ ■
syft/internal/fileresolver/directory_indexer.go
| skipped 369 lines |
370 | 370 | | metadata.LinkDestination = linkTarget |
371 | 371 | | r.index.Add(*ref, metadata) |
372 | 372 | | |
| 373 | + | // if the target path does not exist, then do not report it as a new root, or try to send |
| 374 | + | // syft parsing there. |
| 375 | + | if _, err := os.Stat(targetAbsPath); err != nil && errors.Is(err, os.ErrNotExist) { |
| 376 | + | log.Debugf("link %s points to unresolved path %s, ignoring target as new root", p, targetAbsPath) |
| 377 | + | targetAbsPath = "" |
| 378 | + | } |
| 379 | + | |
373 | 380 | | return targetAbsPath, nil |
374 | 381 | | } |
375 | 382 | | |
| skipped 87 lines |