]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
mkosi: Force /etc/default/locale to be a symlink to locale.conf 952/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 20 Apr 2022 18:08:24 +0000 (20:08 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 20 Apr 2022 18:08:24 +0000 (20:08 +0200)
If the locales package is installed, /etc/default/locale will exist
in the filesystem already. Let's make sure we handle that properly.

mkosi/__init__.py

index 5d1ce87ca533214d0c8066647ac84e86f20d24e4..e4a37092497651c5f0af270e1b2bc06320fac311 100644 (file)
@@ -2836,6 +2836,10 @@ def install_debian_or_ubuntu(args: MkosiArgs, root: Path, *, do_run_build_script
             run_workspace_command(args, root, ["kernel-install", "add", kver, Path("/") / kimg])
 
     root.joinpath("etc/locale.conf").write_text("LANG=C.UTF-8\n")
+    try:
+        root.joinpath("etc/default/locale").unlink()
+    except FileNotFoundError:
+        pass
     root.joinpath("etc/default/locale").symlink_to("/etc/locale.conf")