]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Fix filelists on fedora
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 26 Jul 2023 14:12:58 +0000 (16:12 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 31 Jul 2023 09:57:11 +0000 (11:57 +0200)
We should only download these on older Fedora's, not newer ones.

mkosi/distributions/fedora.py

index a68a89c0bd1bbeafc2cf588cf83833ab55b79535..484b01e92a2f3ce550e5eba7384403a13723d900 100644 (file)
@@ -59,7 +59,8 @@ class FedoraInstaller(DistributionInstaller):
             if url:
                 repos += [Repo(name, url, (gpgurl,))]
 
-        setup_dnf(state, repos, filelists=fedora_release_at_least(state.config.release, "38"))
+        # TODO: Use `filelists=True` when F37 goes EOL.
+        setup_dnf(state, repos, filelists=fedora_release_at_most(state.config.release, "37"))
         invoke_dnf(state, "install", packages, apivfs=apivfs)
 
     @classmethod
@@ -86,10 +87,10 @@ class FedoraInstaller(DistributionInstaller):
         return a
 
 
-def fedora_release_at_least(release: str, threshold: str) -> bool:
+def fedora_release_at_most(release: str, threshold: str) -> bool:
     if release in ("rawhide", "eln"):
-        return True
-    if threshold in ("rawhide", "eln"):
         return False
+    if threshold in ("rawhide", "eln"):
+        return True
     # If neither is 'rawhide', both must be integers
-    return int(release) >= int(threshold)
+    return int(release) <= int(threshold)