Skip to content

Fix install_update not removing old release files#6

Merged
Dari0o merged 1 commit into
Dari0o:mainfrom
Shivam-1502:fix-update-not-deleting-old-files
Jul 9, 2026
Merged

Fix install_update not removing old release files#6
Dari0o merged 1 commit into
Dari0o:mainfrom
Shivam-1502:fix-update-not-deleting-old-files

Conversation

@Shivam-1502

Copy link
Copy Markdown
Contributor

Fixes the update bug where old version files stayed behind after
running python BackupManager.py --update.

Problem

install_update only copied/overwrote files from the new release into
the install directory — it never removed files from the old version
that the new release no longer includes. E.g. updating from a flat
layout to one using src/ left the old root-level BackupManager.py
sitting next to the new src/ folder.

Fix

install_update now clears the install directory of everything except
its own in-progress update artifacts (update_temp/, update.zip)
before copying the new release in, so only the newest release's
files/directories remain afterward.

Testing

Added two tests: one confirming old files/directories are removed
and replaced by the new release's contents, and one confirming the
existing empty-zip failure path leaves the install untouched.
Ran the full test suite locally: 20/20 passing, no regressions.

The update process only copied/overwrote files from the new release into the install directory, but never removed files that existed in the old version and aren't part of the new one. This left stale files (e.g. a pre-src-restructure BackupManager.py) sitting alongside the new release.

install_update now clears the install directory of everything except its own in-progress update artifacts (update_temp/, update.zip) before copying the new release in, so only the newest release's files/directories remain afterward.

Added tests covering: old files being removed on update, and the empty-zip failure path leaving the install untouched.
@Dari0o

Dari0o commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Hi @Shivam-1502, thanks for working on this!

@Dari0o
Dari0o merged commit 64ca94b into Dari0o:main Jul 9, 2026
4 checks passed
@Shivam-1502
Shivam-1502 deleted the fix-update-not-deleting-old-files branch July 9, 2026 18:31
@Shivam-1502

Copy link
Copy Markdown
Contributor Author

Welcome! Let me if help in anything else. Also wanna connect with you. @Dari0o

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants