Skip to content

Commit

Permalink
Merge pull request #192 from rocky-linux/fix/debuginfo
Browse files Browse the repository at this point in the history
fix: match against a regex for debug* packages
  • Loading branch information
resf-prow[bot] authored Jul 23, 2024
2 parents 68e2db8 + 05961c8 commit dba4868
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions peridot/composetools/rpm.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ package composetools
import (
"errors"
"fmt"
"github.com/gobwas/glob"
"path/filepath"
"regexp"
"strings"

"github.com/gobwas/glob"
"peridot.resf.org/apollo/rpmutils"
"peridot.resf.org/peridot/yummeta"
"peridot.resf.org/utils"
"strings"
)

var (
Expand All @@ -47,6 +49,7 @@ var (

var (
debugSuffixes = []string{"-debuginfo", "-debugsource", "-debuginfo-common"}
debugRegex = regexp.MustCompile(`^(?:.*-debuginfo(?:-.*)?|.*-debuginfo-.*|.*-debugsource)$`)
soGlob = glob.MustCompile("*.so.*")
gtk2EnginesGlob = glob.MustCompile("/usr/lib*/gtk-2.0/*/engines")
gtk2ModulesGlob = glob.MustCompile("/usr/lib*/gtk-2.0/*/modules")
Expand All @@ -70,12 +73,9 @@ func StripDebugSuffixes(name string) string {
}

func IsDebugPackage(name string) bool {
for _, suffix := range debugSuffixes {
if strings.HasSuffix(name, suffix) {
return true
}
if debugRegex.MatchString(name) {
return true
}

return false
}

Expand Down

0 comments on commit dba4868

Please sign in to comment.