fix(build): debian specificities build.

This commit is contained in:
Alexandre Pujol 2023-04-24 00:01:35 +01:00
parent 63751ea66f
commit b9b3d0fab1
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
4 changed files with 12 additions and 6 deletions

View file

@ -13,7 +13,7 @@ import (
)
var (
regABI = regexp.MustCompile(`abi.*,\n`)
regABI = regexp.MustCompile(`abi <abi/[0-9.]*>,\n\n`)
regAttachments = regexp.MustCompile(`(profile .* @{exec_path})`)
regFlag = regexp.MustCompile(`flags=\(([^)]+)\)`)
regProfileHeader = regexp.MustCompile(` {`)

View file

@ -146,7 +146,17 @@ func Configure() error {
}
}
}
files, _ := RootApparmord.Join("abstractions").ReadDir(paths.FilterOutDirectories())
for _, file := range files {
if !file.Exist() {
continue
}
content, _ := file.ReadFile()
profile := BuildABI(string(content))
if err := file.WriteFile([]byte(profile)); err != nil {
return err
}
}
default:
return fmt.Errorf("%s is not a supported distribution", Distribution)