Fix install_update not removing old release files#6
Merged
Conversation
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.
Owner
|
Hi @Shivam-1502, thanks for working on this! |
Contributor
Author
|
Welcome! Let me if help in anything else. Also wanna connect with you. @Dari0o |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.