mirror of
https://github.com/anchore/syft.git
synced 2026-11-04 00:16:38 +01:00
change dir resolver to include virtual path (#2259)
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
@@ -261,13 +261,14 @@ func (u UnindexedDirectory) Write(location file.Location, reader io.Reader) erro
|
||||
func (u UnindexedDirectory) newLocation(filePath string, resolveLinks bool) *file.Location {
|
||||
filePath = path.Clean(filePath)
|
||||
|
||||
virtualPath := ""
|
||||
virtualPath := filePath
|
||||
realPath := filePath
|
||||
|
||||
if resolveLinks {
|
||||
paths := u.resolveLinks(filePath)
|
||||
if len(paths) > 1 {
|
||||
realPath = paths[len(paths)-1]
|
||||
// TODO: this is not quite correct, as the equivalent of os.EvalSymlinks needs to be done (in the context of afero)
|
||||
if realPath != path.Clean(filePath) {
|
||||
virtualPath = paths[0]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user