Add OpenSUSE detection to Linux system lib

master
Brendan Coles 2019-03-13 23:18:54 +00:00
parent cc3cc7b7dd
commit 56bff4f748
1 changed files with 7 additions and 1 deletions

View File

@ -85,12 +85,18 @@ module System
system_data[:distro] = "mandrake"
system_data[:version] = version
#SuSE
# SuSE
elsif etc_files.include?("SuSE-release")
version = read_file("/etc/SuSE-release").gsub(/\n|\\n|\\l/,'')
system_data[:distro] = "suse"
system_data[:version] = version
# OpenSUSE
elsif etc_files.include?("SUSE-brand")
version = read_file("/etc/SUSE-brand").scan(/^VERSION\s*=\s*([\d\.]+)/).flatten.first
system_data[:distro] = 'suse'
system_data[:version] = version
# Gentoo
elsif etc_files.include?("gentoo-release")
version = read_file("/etc/gentoo-release").gsub(/\n|\\n|\\l/,'')