1948-filter-pkg-by-type (#2011)

---------

Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
This commit is contained in:
Christopher Angelo Phillips
2023-08-09 16:05:52 -04:00
committed by GitHub
parent 6bf6f85584
commit 541c8d339b
13 changed files with 39 additions and 45 deletions
+2 -2
View File
@@ -12,7 +12,7 @@ import (
)
const (
CatalogerName = "nix-store-cataloger"
catalogerName = "nix-store-cataloger"
nixStoreGlob = "**/nix/store/*"
)
@@ -24,7 +24,7 @@ func NewStoreCataloger() *StoreCataloger {
}
func (c *StoreCataloger) Name() string {
return CatalogerName
return catalogerName
}
func (c *StoreCataloger) Catalog(resolver file.Resolver) ([]pkg.Package, []artifact.Relationship, error) {
+1 -1
View File
@@ -24,7 +24,7 @@ func TestCataloger_Catalog(t *testing.T) {
Version: "2.34-210",
PURL: "pkg:nix/glibc@2.34-210?output=bin&outputhash=h0cnbmfcn93xm5dg2x27ixhag1cwndga",
Locations: file.NewLocationSet(file.NewLocation("nix/store/h0cnbmfcn93xm5dg2x27ixhag1cwndga-glibc-2.34-210-bin")),
FoundBy: CatalogerName,
FoundBy: catalogerName,
Type: pkg.NixPkg,
MetadataType: pkg.NixStoreMetadataType,
Metadata: pkg.NixStoreMetadata{
+1 -1
View File
@@ -10,7 +10,7 @@ func newNixStorePackage(storePath nixStorePath, locations ...file.Location) pkg.
p := pkg.Package{
Name: storePath.name,
Version: storePath.version,
FoundBy: CatalogerName,
FoundBy: catalogerName,
Locations: file.NewLocationSet(locations...),
Type: pkg.NixPkg,
PURL: packageURL(storePath),