From: Daan De Meyer Date: Fri, 3 Nov 2023 19:53:26 +0000 (+0100) Subject: Skip symlink when prefixing everything in staging directory X-Git-Tag: v19~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71d8e93ca06ed2b0b235cabf2589262b3e863241;p=thirdparty%2Fmkosi.git Skip symlink when prefixing everything in staging directory The symlink shouldn't be prefixed so make sure we skip it. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 982116eb6..01d2d71ce 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -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}"