check for multiple delimiters when parsing pom properties

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
Alex Goodman
2021-03-20 08:00:08 -04:00
parent c828e47765
commit 2f8a568d4f
8 changed files with 68 additions and 9 deletions
+20
View File
@@ -1,6 +1,8 @@
package source
import (
"fmt"
"github.com/anchore/syft/internal/log"
"github.com/anchore/stereoscope/pkg/file"
@@ -42,3 +44,21 @@ func NewLocationFromImage(virtualPath string, ref file.Reference, img *image.Ima
ref: ref,
}
}
func (l Location) String() string {
str := ""
if l.ref.ID() != 0 {
str += fmt.Sprintf("id=%d ", l.ref.ID())
}
str += fmt.Sprintf("RealPath=%q", l.RealPath)
if l.VirtualPath != "" {
str += fmt.Sprintf(" VirtualPath=%q", l.VirtualPath)
}
if l.FileSystemID != "" {
str += fmt.Sprintf(" Layer=%q", l.FileSystemID)
}
return fmt.Sprintf("Location<%s>", str)
}