build: improve attachments resolution.

This commit is contained in:
Alexandre Pujol 2023-04-24 12:51:16 +01:00
parent 38d310c62a
commit 7a70252e26
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
2 changed files with 30 additions and 7 deletions

View file

@ -67,13 +67,8 @@ func (p *AppArmorProfile) resolve(str string) []string {
if len(match) > 1 {
variable := match[0]
varname := match[1]
if len(p.Variables[varname]) > 1 {
for _, value := range p.Variables[varname] {
newVar := strings.ReplaceAll(str, variable, value)
vars = append(vars, p.resolve(newVar)...)
}
} else {
newVar := strings.ReplaceAll(str, variable, p.Variables[varname][0])
for _, value := range p.Variables[varname] {
newVar := strings.ReplaceAll(str, variable, value)
vars = append(vars, p.resolve(newVar)...)
}
} else {