diff --git a/pkg/fs/fs.go b/pkg/fs/fs.go index 480c222..329e894 100644 --- a/pkg/fs/fs.go +++ b/pkg/fs/fs.go @@ -24,7 +24,7 @@ import ( func BuildPackageFromDir(input string, kdoc *k8spdx.Document, kpkg *k8spdx.Package, license string, ) error { if _, err := os.Lstat(input); err != nil { - log.Error().Err(err).Str("path", input).Msg("unable to find path") + log.Error().Err(err).Str("path", input).Msg("unable to find path1") return err } @@ -162,7 +162,7 @@ func BuildPackageFromDir(input string, kdoc *k8spdx.Document, kpkg *k8spdx.Packa func BuildPackageFromFile(input string, kpkg *k8spdx.Package, license string) error { ifo, err := os.Lstat(input) if err != nil { - log.Error().Err(err).Str("path", input).Msg("unable to find path") + log.Error().Err(err).Str("path", input).Msg("unable to find path2") return err } @@ -228,11 +228,14 @@ func BuildPackageFromFile(input string, kpkg *k8spdx.Package, license string) er for _, tfil := range sdoc.Files { conv := stbom.ConvertFromSyftFile(tfil) conv.LicenseConcluded = license + conv.Name = filepath.Join(filepath.Dir(input), conv.Name) tfils[conv.SPDXID()] = conv + log.Info().Str("path", conv.Name).Msg("CONVFILE1") + pfo, err := os.Lstat(conv.Name) if err != nil { - log.Error().Err(err).Str("path", conv.Name).Msg("unable to find path") + log.Error().Err(err).Str("path", conv.Name).Msg("unable to find path3") return err }