Add Archlinux to list of supported distros
There is a bug with `platform.linux_distribution()`, which returns an empty value on Archlinux with python2. This bug is fixed in python3, but *will not* be fixed in python2. This patch fixes that issue with a dirty hack: on archlinux, there is a file that can be used to detect an archlinux machine. that file is `/etc/arch-release`. if the file exists, then the OS variable will be set to "linux-arch". You can learn more about that issue on the python bug platform: https://bugs.python.org/issue20454 Signed-off-by: Philippe Loctaux <loctauxphilippe@gmail.com> Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
parent
d9301254ff
commit
761e10e8b1
@ -49,6 +49,8 @@ def get_os_name():
|
||||
DISTRO = platform.linux_distribution()[0]
|
||||
if DISTRO:
|
||||
OS = OS + "-%s" % DISTRO.split()[0].lower()
|
||||
if os.path.exists('/etc/arch-release'):
|
||||
OS = "linux-arch"
|
||||
|
||||
return OS
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user