]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Skip symlink when prefixing everything in staging directory
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 3 Nov 2023 19:53:26 +0000 (20:53 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 4 Nov 2023 01:04:51 +0000 (02:04 +0100)
The symlink shouldn't be prefixed so make sure we skip it.

mkosi/__init__.py

index 982116eb694f1c59820f272501bf2d359ad6f9f2..01d2d71ce4b6e6f128117a66e6b55fff8740396b 100644 (file)
@@ -2064,6 +2064,10 @@ def finalize_staging(state: MkosiState) -> None:
     # Our output unlinking logic removes everything prefixed with the name of the image, so let's make
     # sure that everything we put into the output directory is prefixed with the name of the output.
     for f in state.staging.iterdir():
+        # Skip the symlink we create without the version that points to the output with the version.
+        if f.name.startswith(state.config.output) and f.is_symlink():
+            continue
+
         name = f.name
         if not name.startswith(state.config.output_with_version):
             name = f"{state.config.output_with_version}-{name}"