Unify component setup across categories and retain two installation backups

This commit is contained in:
Mikei386
2026-09-30 21:36:47 +02:00
parent b731811482
commit 94bfb1ac78
8 changed files with 90 additions and 16 deletions
+3
View File
@@ -218,6 +218,9 @@ def update(base, rollback=False, force=False, api_ports=None, reuse_runtime=Fals
if was_running:run('docker','start',config['name'])
raise RuntimeError('Update fehlgeschlagen. Vorheriger Deck-Container wiederhergestellt.') from None
run('docker','rm',backup_name)
# Keep only two automatic pre-update state snapshots after a successful update.
snapshots=sorted((p for p in (base/'backups').iterdir() if p.is_dir() and not p.is_symlink() and p.name.isdigit()),key=lambda p:int(p.name))
for snapshot in snapshots[:-2]:shutil.rmtree(snapshot)
print('Nur Athena Deck wurde aktualisiert. Vorheriges Image bleibt für --rollback erhalten.')