sb/linux.py: Simplify "distro" determination

This fixes an issue on Debian 11 which contains "Debian" in /etc/issue
(capital D).
This commit is contained in:
Sebastian Huber 2022-01-20 12:48:53 +01:00
parent 45b2952ed8
commit 09b84c4c2a

View File

@ -76,20 +76,16 @@ def load():
except:
pass
distro = distro.lower()
# Manage distro aliases
if distro in ['centos']:
distro = 'redhat'
elif distro in ['fedora']:
if distro_ver < 17:
distro = 'redhat'
elif distro in ['centos', 'fedora']:
distro = 'redhat'
elif distro in ['Ubuntu', 'ubuntu', 'MX', 'LinuxMint', 'linuxmint']:
elif distro in ['ubuntu', 'mx', 'linuxmint']:
distro = 'debian'
elif distro in ['Arch']:
distro = 'arch'
elif distro in ['SuSE']:
distro = 'suse'
variations = {
'debian' : { '__bzip2': ('exe', 'required', '/bin/bzip2'),