github.com/anchore/syft@v1.4.2-0.20240516191711-1bec1fc5d397/syft/pkg/cataloger/debian/cataloger.go (about)

     1  /*
     2  Package debian provides a concrete Cataloger implementation relating to packages within the Debian linux distribution.
     3  */
     4  package debian
     5  
     6  import (
     7  	"github.com/anchore/syft/syft/pkg"
     8  	"github.com/anchore/syft/syft/pkg/cataloger/generic"
     9  	"github.com/anchore/syft/syft/pkg/cataloger/internal/dependency"
    10  )
    11  
    12  // NewDBCataloger returns a new Deb package cataloger capable of parsing DPKG status DB flat-file stores.
    13  func NewDBCataloger() pkg.Cataloger {
    14  	return generic.NewCataloger("dpkg-db-cataloger").
    15  		// note: these globs have been intentionally split up in order to improve search performance,
    16  		// please do NOT combine into: "**/var/lib/dpkg/{status,status.d/*}"
    17  		WithParserByGlobs(parseDpkgDB, "**/var/lib/dpkg/status", "**/var/lib/dpkg/status.d/*", "**/lib/opkg/info/*.control", "**/lib/opkg/status").
    18  		WithProcessors(dependency.Processor(dbEntryDependencySpecifier))
    19  }