From: Daan De Meyer Date: Fri, 15 Jul 2022 20:04:36 +0000 (+0200) Subject: Move debian/ubuntu locale symlink logic to install function X-Git-Tag: v14~101 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26c50914369a3640f7ecccbfd305430ca152598d;p=thirdparty%2Fmkosi.git Move debian/ubuntu locale symlink logic to install function Let's get rid of another distribution check by simply creating the symlink in the install function. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 6890334d3..81e023eb6 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -1640,15 +1640,6 @@ def install_etc_locale(args: MkosiArgs, root: Path, cached: bool) -> None: # Let's ensure we use a UTF-8 locale everywhere. etc_locale.write_text("LANG=C.UTF-8\n") - # Debian/Ubuntu use a different path to store the locale so let's make sure that path is a symlink to - # etc/locale.conf. - if args.distribution in (Distribution.debian, Distribution.ubuntu): - try: - root.joinpath("etc/default/locale").unlink() - except FileNotFoundError: - pass - root.joinpath("etc/default/locale").symlink_to("../locale.conf") - def install_etc_hostname(args: MkosiArgs, root: Path, cached: bool) -> None: if cached: @@ -2717,6 +2708,14 @@ def install_debian_or_ubuntu(args: MkosiArgs, root: Path, *, do_run_build_script write_resource(root / "etc/kernel/install.d/50-mkosi-dpkg-reconfigure-dracut.install", "mkosi.resources", "dpkg-reconfigure-dracut.install", executable=True) + # Debian/Ubuntu use a different path to store the locale so let's make sure that path is a symlink to + # etc/locale.conf. + try: + root.joinpath("etc/default/locale").unlink() + except FileNotFoundError: + pass + root.joinpath("etc/default/locale").symlink_to("../locale.conf") + @complete_step("Installing Debian…") def install_debian(args: MkosiArgs, root: Path, do_run_build_script: bool) -> None: