1
0

feat: implement openSUSE 42+ support

This commit is contained in:
2023-06-15 15:24:29 +00:00
parent c12b0a8829
commit a6944050cc
16 changed files with 253 additions and 25 deletions

View File

@ -18,10 +18,12 @@ const (
Debian
// OracleLinux https://www.oracle.com/linux/
OracleLinux
// OpenSUSE https://opensuse.org/
OpenSUSE
)
var IDs = []ID{
None, Ubuntu, CentOS, Debian, OracleLinux,
None, Ubuntu, CentOS, Debian, OracleLinux, OpenSUSE,
}
var nameStrings = [...]string{
@ -30,6 +32,7 @@ var nameStrings = [...]string{
"CentOS",
"Debian",
"OracleLinux",
"openSUSE",
}
func NewID(name string) (id ID, err error) {
@ -52,6 +55,8 @@ func (id *ID) UnmarshalTOML(data []byte) (err error) {
*id = Debian
} else if strings.EqualFold(name, "OracleLinux") {
*id = OracleLinux
} else if strings.EqualFold(name, "openSUSE") {
*id = OpenSUSE
} else if name != "" {
err = fmt.Errorf("distro %s is not supported", name)
} else {