From: Daan De Meyer Date: Wed, 22 Jan 2025 16:06:16 +0000 (+0100) Subject: Fix copying of crypto policies from tools tree X-Git-Tag: v25~11^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d18b4a5dc7aa1f20c4a1125948a1f538397fa3ff;p=thirdparty%2Fmkosi.git Fix copying of crypto policies from tools tree These files should have the .config extension in /etc/crypto-policies, but they have the .txt extension in /usr/share/crypto-policies. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 2c072df51..afcca6d28 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -1089,6 +1089,12 @@ def install_sandbox_trees(config: Config, dst: Path) -> None: Path(dst / "etc/crypto-policies").mkdir(exist_ok=True) copy_tree(p, dst / "etc/crypto-policies/back-ends", sandbox=config.sandbox) + # The files in /usr/share/crypto-policies have the .txt extension but in /etc/crypto-policies it + # should have the .config extension so rename all the files after copying them. + for p in (dst / "etc/crypto-policies/back-ends").iterdir(): + if p.suffix == ".txt": + p.rename(p.with_suffix(".config")) + if config.sandbox_trees: with complete_step("Copying in sandbox trees…"): for tree in config.sandbox_trees: