]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Fix copying of crypto policies from tools tree
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 22 Jan 2025 16:06:16 +0000 (17:06 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 22 Jan 2025 16:06:16 +0000 (17:06 +0100)
These files should have the .config extension in /etc/crypto-policies,
but they have the .txt extension in /usr/share/crypto-policies.

mkosi/__init__.py

index 2c072df514b8e11c623eafb45bfaf505c58fbaeb..afcca6d2845224e891fec451464f4726ed8a8832 100644 (file)
@@ -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: