mirror of
https://github.com/rocky-linux/peridot.git
synced 2024-11-21 20:51:26 +00:00
fix: match against a regex for debug* packages
This commit is contained in:
parent
68e2db8af0
commit
05961c8f61
@ -33,12 +33,14 @@ package composetools
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/gobwas/glob"
|
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"regexp"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"github.com/gobwas/glob"
|
||||||
"peridot.resf.org/apollo/rpmutils"
|
"peridot.resf.org/apollo/rpmutils"
|
||||||
"peridot.resf.org/peridot/yummeta"
|
"peridot.resf.org/peridot/yummeta"
|
||||||
"peridot.resf.org/utils"
|
"peridot.resf.org/utils"
|
||||||
"strings"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -47,6 +49,7 @@ var (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
debugSuffixes = []string{"-debuginfo", "-debugsource", "-debuginfo-common"}
|
debugSuffixes = []string{"-debuginfo", "-debugsource", "-debuginfo-common"}
|
||||||
|
debugRegex = regexp.MustCompile(`^(?:.*-debuginfo(?:-.*)?|.*-debuginfo-.*|.*-debugsource)$`)
|
||||||
soGlob = glob.MustCompile("*.so.*")
|
soGlob = glob.MustCompile("*.so.*")
|
||||||
gtk2EnginesGlob = glob.MustCompile("/usr/lib*/gtk-2.0/*/engines")
|
gtk2EnginesGlob = glob.MustCompile("/usr/lib*/gtk-2.0/*/engines")
|
||||||
gtk2ModulesGlob = glob.MustCompile("/usr/lib*/gtk-2.0/*/modules")
|
gtk2ModulesGlob = glob.MustCompile("/usr/lib*/gtk-2.0/*/modules")
|
||||||
@ -70,12 +73,9 @@ func StripDebugSuffixes(name string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func IsDebugPackage(name string) bool {
|
func IsDebugPackage(name string) bool {
|
||||||
for _, suffix := range debugSuffixes {
|
if debugRegex.MatchString(name) {
|
||||||
if strings.HasSuffix(name, suffix) {
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user