From 83bab9804697b5a047aeb94b6900c940dcd788ac Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 19 Apr 2026 09:54:14 +0000 Subject: [PATCH] fix(core_dl): fix zip extraction with extractsrc across devices and non-empty dirs Using mv to move extracted directories fails in two cases: - Cross-device moves (e.g. tmp and serverfiles on different Docker volumes) - Target directory already exists and is non-empty (update scenario) Replace find+mv with cp -a which handles both cases by copying recursively and merging into the destination. Also replace the hardcoded 'Xonotic' temp_extractdir with ${extractsrc} to be generic. --- lgsm/modules/core_dl.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/modules/core_dl.sh b/lgsm/modules/core_dl.sh index 0a0dacb29..e8fe5687b 100755 --- a/lgsm/modules/core_dl.sh +++ b/lgsm/modules/core_dl.sh @@ -267,9 +267,9 @@ fn_dl_extract() { fi elif [ "${mime}" == "application/zip" ]; then if [ -n "${extractsrc}" ]; then - temp_extractdir="${tmpdir}/Xonotic" + temp_extractdir="${tmpdir}/${extractsrc}" extractcmd=$(unzip -qo "${local_filedir}/${local_filename}" "${extractsrc}/*" -d "${temp_extractdir}") - find "${temp_extractdir}/${extractsrc}" -mindepth 1 -maxdepth 1 -exec mv -t "${extractdest}" {} + + cp -a "${temp_extractdir}/${extractsrc}/." "${extractdest}/" rm -rf "${temp_extractdir}" else extractcmd=$(unzip -qo -d "${extractdest}" "${local_filedir}/${local_filename}")