fix: give each download.sh run its own staging

This commit is contained in:
Abdessamad Derraz committed 2026-11-05 11:41:48 +01:00
1 parent df5de91b37
commit 34293f7bbb
2 files changed
+34 -4

No files matched your search

+5 -4
View File
@@ -152,11 +152,12 @@ EOF
fi
# Staged inside the destination: a pack is gigabytes, and /tmp is a RAM
# disk on the appliances these packs target.
# disk on the appliances these packs target. The folder is this run's own:
# a fixed name let a second download into the same folder empty it while
# the first was still writing its parts.
mkdir -p "$dest"
local staging="${dest%/}/.retrobios-download"
rm -rf "$staging"
mkdir -p "$staging"
local staging
staging=$(mktemp -d "${dest%/}/.retrobios-download-XXXXXX")
STAGING="$staging"
trap cleanup_staging EXIT