From 761e10e8b1decaa75c4e733564134476f8e4f9fe Mon Sep 17 00:00:00 2001 From: Philippe Loctaux Date: Fri, 17 Aug 2018 12:27:41 +0200 Subject: [PATCH] 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 Signed-off-by: Nicolas Sebrecht --- offlineimap/utils/distro.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/offlineimap/utils/distro.py b/offlineimap/utils/distro.py index 00e21e9..08f0456 100644 --- a/offlineimap/utils/distro.py +++ b/offlineimap/utils/distro.py @@ -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