diff options
author | Matthew Waters <matthew@centricular.com> | 2020-10-28 20:02:15 +1100 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2021-06-07 20:25:10 +0100 |
commit | 001f78a2a917842b15b8ec4c0de217625853983f (patch) | |
tree | e9686ee1b292a02ff8102704bc6c7ab284ec5759 | |
parent | 3c79f8f8c21bc908e669e2defe7cbf2c285ac41e (diff) |
enums: generate fedora version strings automatically
Like what is done for iOS now
Part-of: <https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/708>
-rw-r--r-- | cerbero/enums.py | 1 | ||||
-rw-r--r-- | cerbero/utils/__init__.py | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/cerbero/enums.py b/cerbero/enums.py index 9609fb33..c17f5f8f 100644 --- a/cerbero/enums.py +++ b/cerbero/enums.py @@ -114,6 +114,7 @@ class DistroVersion: FEDORA_30 = 'fedora_30' FEDORA_31 = 'fedora_31' FEDORA_32 = 'fedora_32' + # further fedora versions are generated automatically REDHAT_6 = 'redhat_6' REDHAT_7 = 'redhat_7' REDHAT_8 = 'redhat_8' diff --git a/cerbero/utils/__init__.py b/cerbero/utils/__init__.py index 1a9cbdde..0115e0e5 100644 --- a/cerbero/utils/__init__.py +++ b/cerbero/utils/__init__.py @@ -283,6 +283,10 @@ Terminating.''', file=sys.stderr) distro_version = DistroVersion.FEDORA_31 elif d[1] == '32': distro_version = DistroVersion.FEDORA_32 + elif d[0] == 'Fedora': + # str(int()) is for ensuring that the fedora version is + # actually a number + distro_version = 'fedora_' + str(int(d[1])) elif d[1].startswith('6.'): distro_version = DistroVersion.REDHAT_6 elif d[1].startswith('7.'): |