mirror of
https://github.com/anchore/syft.git
synced 2026-11-03 16:06:36 +01:00
Follow convention for naming catalogers (#2277)
* follow convention for naming catalogers Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * fix cataloger name example Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> --------- Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
/*
|
||||
Package nix provides a concrete Cataloger implementation for packages within the Nix packaging ecosystem.
|
||||
*/
|
||||
package nix
|
||||
|
||||
import (
|
||||
@@ -11,10 +14,7 @@ import (
|
||||
"github.com/anchore/syft/syft/pkg"
|
||||
)
|
||||
|
||||
const (
|
||||
catalogerName = "nix-store-cataloger"
|
||||
nixStoreGlob = "**/nix/store/*"
|
||||
)
|
||||
const catalogerName = "nix-store-cataloger"
|
||||
|
||||
// StoreCataloger finds package outputs installed in the Nix store location (/nix/store/*).
|
||||
type StoreCataloger struct{}
|
||||
@@ -32,7 +32,7 @@ func (c *StoreCataloger) Catalog(resolver file.Resolver) ([]pkg.Package, []artif
|
||||
var pkgs []pkg.Package
|
||||
var filesByPath = make(map[string]*file.LocationSet)
|
||||
for location := range resolver.AllLocations() {
|
||||
matchesStorePath, err := doublestar.Match(nixStoreGlob, location.RealPath)
|
||||
matchesStorePath, err := doublestar.Match("**/nix/store/*", location.RealPath)
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("failed to match nix store path: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user