mirror of
https://github.com/anchore/syft.git
synced 2026-11-03 16:06:36 +01:00
1948-filter-pkg-by-type (#2011)
--------- Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user