mirror of
https://github.com/dockur/windows.git
synced 2026-08-24 15:48:59 +01:00
fix: Remove obsolete rebuilt custom ISOs (#2077)
This commit is contained in:
+12
-3
@@ -419,8 +419,8 @@ skipInstall() {
|
||||
|
||||
if [ -n "$previousBase" ]; then
|
||||
|
||||
# Older releases stored the original download name in windows.base. New
|
||||
# releases always store the final ISO name, so migrate legacy state once.
|
||||
# Older releases stored the original download name in windows.base. Current
|
||||
# releases store an ISO source identity, so migrate legacy state once.
|
||||
if [[ "${previousBase,,}" != *.iso ]]; then
|
||||
|
||||
if isCompressed "$previousBase" || [[ "${previousBase,,}" == *.esd ]]; then
|
||||
@@ -437,6 +437,15 @@ skipInstall() {
|
||||
|
||||
fi
|
||||
|
||||
# Older releases may have left a rebuilt custom ISO at its synthetic source
|
||||
# identity. A completed installation no longer needs that installation media.
|
||||
if [[ "${previousBase,,}" == "windows."* ]] && [ -f "$boot" ] && hasData; then
|
||||
if ! rm -f -- "$STORAGE/$previousBase"; then
|
||||
error "Failed to remove obsolete ISO file \"$STORAGE/$previousBase\" !"
|
||||
exit 50
|
||||
fi
|
||||
fi
|
||||
|
||||
# A changed source invalidates an unfinished installation. Back up an
|
||||
# existing installation, but discard stale media when no disk exists yet.
|
||||
if [[ "${STORAGE,,}/${previousBase,,}" != "${iso,,}" ]]; then
|
||||
@@ -590,7 +599,7 @@ findFile() {
|
||||
|
||||
ISO="$file"
|
||||
CUSTOM="$file"
|
||||
# Include the custom ISO size in its persistent name so replacing a
|
||||
# Encode the custom ISO size in a synthetic source identity so replacing a
|
||||
# bind-mounted ISO is detected as a different installation source.
|
||||
BOOT="$STORAGE/windows.$size.iso"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user