]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Simplify crypto-policies copying
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 23 Jan 2025 08:12:14 +0000 (09:12 +0100)
committerJörg Behrmann <behrmann@physik.fu-berlin.de>
Thu, 23 Jan 2025 08:51:23 +0000 (09:51 +0100)
To make matters even more interesting, aside from a bunch of .txt
files in /usr/share/crypto-policies/DEFAULT, there's also the same
files in /usr/share/crypto-policies/back-ends/DEFAULT, but they do
have the .config extension there, so lets simplify the logic by
copying from that location.

mkosi/__init__.py

index 181aed6ad31edebbc5cf64628aaa20bd1f7dfc50..7cd65cbff901c17dcbbf357895d1458abc0c903b 100644 (file)
@@ -1085,16 +1085,10 @@ def install_sandbox_trees(config: Config, dst: Path) -> None:
     # Ensure /etc exists in the sandbox
     (dst / "etc").mkdir(exist_ok=True)
 
-    if (p := config.tools() / "usr/share/crypto-policies/DEFAULT").exists():
+    if (p := config.tools() / "usr/share/crypto-policies/back-ends/DEFAULT").exists():
         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: