[PATCH] sb/linux.py: Simplify "distro" determination

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Jan 20 12:03:25 UTC 2022


This fixes an issue on Debian 11 which contains "Debian" in /etc/issue
(captital D).
---
 source-builder/sb/linux.py | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/source-builder/sb/linux.py b/source-builder/sb/linux.py
index d89377b..d71ac39 100644
--- a/source-builder/sb/linux.py
+++ b/source-builder/sb/linux.py
@@ -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'),
-- 
2.31.1



More information about the devel mailing list