Skip to content

Commit

Permalink
build: allow a larger set of distribution.
Browse files Browse the repository at this point in the history
See #180
  • Loading branch information
roddhjav committed Jul 25, 2023
1 parent 6ea2df1 commit f2e755b
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions pkg/prebuild/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
}
Expand Down

0 comments on commit f2e755b

Please sign in to comment.