diff --git a/syft/pkg/cataloger/nixstore/cataloger.go b/syft/pkg/cataloger/nixstore/cataloger.go index 09dc260277bf..fc1edbf2070d 100644 --- a/syft/pkg/cataloger/nixstore/cataloger.go +++ b/syft/pkg/cataloger/nixstore/cataloger.go @@ -42,7 +42,7 @@ func (c *Cataloger) Catalog(resolver source.FileResolver) ([]pkg.Package, []arti p.Name = name p.Version = version p.FoundBy = c.Name() - p.Locations = []source.Location{storeLocation} + p.Locations = source.NewLocationSet(storeLocation) p.SetID() log.Debug(p) @@ -51,7 +51,7 @@ func (c *Cataloger) Catalog(resolver source.FileResolver) ([]pkg.Package, []arti } else { nixLookupPkg := nixLookupPkg.(pkg.Package) - nixLookupPkg.Locations = append(nixLookupPkg.Locations, storeLocation) + nixLookupPkg.Locations = source.NewLocationSet(append(nixLookupPkg.Locations.ToSlice(), storeLocation)...) pkgMap[fmt.Sprintf("%s-%s", name, version)] = nixLookupPkg } } diff --git a/syft/pkg/nix_store_metadata.go b/syft/pkg/nix_store_metadata.go index 3307fc192229..fddc3d3d2ec5 100644 --- a/syft/pkg/nix_store_metadata.go +++ b/syft/pkg/nix_store_metadata.go @@ -2,7 +2,7 @@ package pkg import ( "github.com/anchore/packageurl-go" - "github.com/anchore/syft/syft/distro" + "github.com/anchore/syft/syft/linux" ) const NixStoreGlob = "/nix/store/**" @@ -15,7 +15,7 @@ type NixStoreMetadata struct { SourceVersion string `mapstructure:"SourceVersion" json:"sourceVersion"` } -func (m NixStoreMetadata) PackageURL(d *distro.Distro) string { +func (m NixStoreMetadata) PackageURL(d *linux.Release) string { if d == nil { return "" } @@ -23,7 +23,7 @@ func (m NixStoreMetadata) PackageURL(d *distro.Distro) string { // TODO: replace with `packageurl.TypeDebian` upon merge of https://github.com/package-url/packageurl-go/pull/21 // TODO: or, since we're now using an Anchore fork of this module, we could do this sooner. "nix", - d.Type.String(), + "", m.Package, m.Version, packageurl.Qualifiers{