build: generalise the use of apparmor version during the build.

This commit is contained in:
Alexandre Pujol 2025-03-30 17:06:00 +02:00
parent d3e9a7ec70
commit baa3f8f639
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
5 changed files with 39 additions and 15 deletions

View file

@ -35,7 +35,7 @@ func (p Configure) Apply() ([]string, error) {
return res, err
}
if prebuild.ABI == 3 {
if prebuild.Version < 3.0 {
if err := paths.CopyTo(prebuild.DistDir.Join("ubuntu"), prebuild.RootApparmord); err != nil {
return res, err
}
@ -46,9 +46,11 @@ func (p Configure) Apply() ([]string, error) {
return res, err
}
// Copy Debian specific abstractions
if err := paths.CopyTo(prebuild.DistDir.Join("ubuntu"), prebuild.RootApparmord); err != nil {
return res, err
if prebuild.Version < 4.1 {
// Copy Debian specific abstractions
if err := paths.CopyTo(prebuild.DistDir.Join("ubuntu"), prebuild.RootApparmord); err != nil {
return res, err
}
}
default:
@ -56,7 +58,7 @@ func (p Configure) Apply() ([]string, error) {
}
if prebuild.Version == "4.1" {
if prebuild.Version == 4.1 {
// Remove files upstreamed in 4.1
remove := []string{
"abstractions/devices-usb-read",