mirror of
https://github.com/roddhjav/apparmor.d.git
synced 2024-11-14 23:43:56 +01:00
parent
6ea2df19eb
commit
f2e755b77b
@ -15,6 +15,13 @@ import (
|
||||
var (
|
||||
osReleaseFile = "/etc/os-release"
|
||||
firstPartyDists = []string{"arch", "debian", "ubuntu", "opensuse", "whonix"}
|
||||
supportedDists = map[string][]string{
|
||||
"arch": {},
|
||||
"debian": {},
|
||||
"ubuntu": {},
|
||||
"opensuse": {"suse"},
|
||||
"whonix": {},
|
||||
}
|
||||
)
|
||||
|
||||
func getSupportedDistribution() string {
|
||||
@ -39,10 +46,14 @@ func getSupportedDistribution() string {
|
||||
}
|
||||
}
|
||||
|
||||
if slices.Contains(firstPartyDists, id) {
|
||||
return id
|
||||
} else if slices.Contains(firstPartyDists, id_like) {
|
||||
return id_like
|
||||
for main, based := range supportedDists {
|
||||
if main == id || main == id_like {
|
||||
return main
|
||||
} else if slices.Contains(based, id) {
|
||||
return main
|
||||
} else if slices.Contains(based, id_like) {
|
||||
return main
|
||||
}
|
||||
}
|
||||
return id
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user