]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
fedora: only add glibc-minimal-langpack for F33- 834/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 11 Sep 2021 06:54:54 +0000 (08:54 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 13 Oct 2021 15:31:35 +0000 (17:31 +0200)
Since F34, glibc changed from 'Suggests: glibc-all-langpacks' to
'Suggests: glibc-minimal-langpack', so we don't need to do this ourselves.
The advantage is that we avoid one line of output from dnf (about
glibc-minimal-langpack being already installed, which is confusing when
the user didn't request glibc-minimal-langpack explicitly).

mkosi/__init__.py

index 477cb537a7992f253b64944963bb5782b8b69a18..298651e2d7da842c7863ddfe88e59e51fa73b53d 100644 (file)
@@ -257,6 +257,14 @@ FEDORA_KEYS_MAP = {
     "36": "53DED2CB922D8B8D9E63FD18999F7CBF38AB71F4",
 }
 
+def fedora_release_cmp(a: str, b: str) -> int:
+    """Return negative if a<b, 0 if a==b, positive otherwise"""
+
+    # This will throw ValueError on non-integer strings
+    anum = 1000 if a == "rawhide" else int(a)
+    bnum = 1000 if b == "rawhide" else int(b)
+    return anum - bnum
+
 
 # Debian calls their architectures differently, so when calling debootstrap we
 # will have to map to their names
@@ -2068,7 +2076,10 @@ def install_fedora(args: CommandLineArguments, root: Path, do_run_build_script:
 
     packages = {*args.packages}
     add_packages(args, packages, "fedora-release", "systemd")
-    add_packages(args, packages, "glibc-minimal-langpack", conditional="glibc")
+
+    if fedora_release_cmp(args.release, "34") < 0:
+        add_packages(args, packages, "glibc-minimal-langpack", conditional="glibc")
+
     if not do_run_build_script and args.bootable:
         add_packages(args, packages, "kernel-core", "kernel-modules", "binutils", "dracut")
         add_packages(args, packages, "systemd-udev", conditional="systemd")