]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Fix install_tree() file copy regression
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 6 Aug 2023 13:03:32 +0000 (15:03 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 6 Aug 2023 17:30:33 +0000 (19:30 +0200)
If a target is set and the source is a file, we used to copy the
file directory into the image. Let's restore that behavior.

mkosi/tree.py

index 3cd2173cfc650fb93bcfd13af419cfd68eba3ffe..06e01198695533b5419d48c316919ac49b7ef3bc 100644 (file)
@@ -107,7 +107,7 @@ def install_tree(config: MkosiConfig, src: Path, dst: Path, target: Optional[Pat
     with umask(~0o755):
         t.parent.mkdir(parents=True, exist_ok=True)
 
-    if src.is_dir():
+    if src.is_dir() or (src.is_file() and target):
         copy_tree(config, src, t, preserve_owner=False)
     elif src.suffix == ".tar":
         extract_tar(src, t)