From 9be612fec6266d2169ffec05a54adcae1440565a Mon Sep 17 00:00:00 2001 From: Boria138 Date: Tue, 23 Jan 2024 13:05:11 +0600 Subject: [PATCH] Added checking the /etc/os-release file I'm using an arch-based distribution in which does not have an arch-release file but has an ID_LIKE line in os-release --- bauh/view/util/util.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bauh/view/util/util.py b/bauh/view/util/util.py index 2ec4365b..42dbe685 100644 --- a/bauh/view/util/util.py +++ b/bauh/view/util/util.py @@ -48,6 +48,12 @@ def get_distro(): if os.path.exists('/etc/arch-release'): return 'arch' + if os.path.exists('/etc/os-release'): + with open('/etc/os-release', 'r') as os_release_file: + for line in os_release_file: + if 'ID_LIKE=arch' in line: + return 'arch' + if os.path.exists('/proc/version'): if 'ubuntu' in run_cmd('cat /proc/version').lower(): return 'ubuntu'