parent
6ea2df19eb
commit
f2e755b77b
1 changed files with 15 additions and 4 deletions
|
|
@ -15,6 +15,13 @@ import (
|
||||||
var (
|
var (
|
||||||
osReleaseFile = "/etc/os-release"
|
osReleaseFile = "/etc/os-release"
|
||||||
firstPartyDists = []string{"arch", "debian", "ubuntu", "opensuse", "whonix"}
|
firstPartyDists = []string{"arch", "debian", "ubuntu", "opensuse", "whonix"}
|
||||||
|
supportedDists = map[string][]string{
|
||||||
|
"arch": {},
|
||||||
|
"debian": {},
|
||||||
|
"ubuntu": {},
|
||||||
|
"opensuse": {"suse"},
|
||||||
|
"whonix": {},
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
func getSupportedDistribution() string {
|
func getSupportedDistribution() string {
|
||||||
|
|
@ -39,10 +46,14 @@ func getSupportedDistribution() string {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if slices.Contains(firstPartyDists, id) {
|
for main, based := range supportedDists {
|
||||||
return id
|
if main == id || main == id_like {
|
||||||
} else if slices.Contains(firstPartyDists, id_like) {
|
return main
|
||||||
return id_like
|
} else if slices.Contains(based, id) {
|
||||||
|
return main
|
||||||
|
} else if slices.Contains(based, id_like) {
|
||||||
|
return main
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return id
|
return id
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue