cataloger: use ** for glob patterns

Signed-off-by: Alfredo Deza <adeza@anchore.com>
This commit is contained in:
Alfredo Deza 2020-07-20 15:55:32 -04:00
parent 03bbcfa08d
commit cea38fcba3
5 changed files with 14 additions and 14 deletions

View File

@ -13,7 +13,7 @@ type Cataloger struct {
func NewCataloger() *Cataloger {
globParsers := map[string]common.ParserFn{
"*/Gemfile.lock": parseGemfileLockEntries,
"**/Gemfile.lock": parseGemfileLockEntries,
}
return &Cataloger{

View File

@ -12,12 +12,12 @@ type Cataloger struct {
}
func NewCataloger() *Cataloger {
pathParsers := map[string]common.ParserFn{
"/var/lib/dpkg/status": parseDpkgStatus,
globParsers := map[string]common.ParserFn{
"**/var/lib/dpkg/status": parseDpkgStatus,
}
return &Cataloger{
cataloger: common.NewGenericCataloger(pathParsers, nil),
cataloger: common.NewGenericCataloger(nil, globParsers),
}
}

View File

@ -11,11 +11,11 @@ import (
)
var archiveFormatGlobs = []string{
"*.jar",
"*.war",
"*.ear",
"*.jpi",
"*.hpi",
"**/*.jar",
"**/*.war",
"**/*.ear",
"**/*.jpi",
"**/*.hpi",
}
type archiveParser struct {

View File

@ -13,8 +13,8 @@ type Cataloger struct {
func NewCataloger() *Cataloger {
globParsers := map[string]common.ParserFn{
"*egg-info/PKG-INFO": parseEggMetadata,
"*dist-info/METADATA": parseWheelMetadata,
"**/egg-info/PKG-INFO": parseEggMetadata,
"**/dist-info/METADATA": parseWheelMetadata,
}
return &Cataloger{

View File

@ -12,12 +12,12 @@ type Cataloger struct {
}
func NewCataloger() *Cataloger {
pathParsers := map[string]common.ParserFn{
"/var/lib/rpm/Packages": parseRpmDB,
globParsers := map[string]common.ParserFn{
"**/var/lib/rpm/Packages": parseRpmDB,
}
return &Cataloger{
cataloger: common.NewGenericCataloger(pathParsers, nil),
cataloger: common.NewGenericCataloger(nil, globParsers),
}
}