mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01:00
35 lines
805 B
Go
35 lines
805 B
Go
package dpkg
|
|
|
|
import (
|
|
"github.com/anchore/imgbom/imgbom/cataloger/common"
|
|
"github.com/anchore/imgbom/imgbom/pkg"
|
|
"github.com/anchore/imgbom/imgbom/scope"
|
|
"github.com/anchore/stereoscope/pkg/file"
|
|
)
|
|
|
|
type Cataloger struct {
|
|
cataloger common.GenericCataloger
|
|
}
|
|
|
|
func NewCataloger() *Cataloger {
|
|
globParsers := map[string]common.ParserFn{
|
|
"**/var/lib/dpkg/status": parseDpkgStatus,
|
|
}
|
|
|
|
return &Cataloger{
|
|
cataloger: common.NewGenericCataloger(nil, globParsers),
|
|
}
|
|
}
|
|
|
|
func (a *Cataloger) Name() string {
|
|
return "dpkg-cataloger"
|
|
}
|
|
|
|
func (a *Cataloger) SelectFiles(resolver scope.FileResolver) []file.Reference {
|
|
return a.cataloger.SelectFiles(resolver)
|
|
}
|
|
|
|
func (a *Cataloger) Catalog(contents map[file.Reference]string) ([]pkg.Package, error) {
|
|
return a.cataloger.Catalog(contents, a.Name())
|
|
}
|