Skip to content

Commit

Permalink
umu_runtime: remove the old runtime after installing the latest
Browse files Browse the repository at this point in the history
- Always remove the old runtime directory after installing the latest runtime. We want user's to always be using the latest runtime and Proton, and this avoids bloating the user's home directory. However, in the next release, the old runtime directory which should be sniper_platform_0.20240125.75305 will remain as the BUILD_ID.txt file did not exist at the time of the RC4 release, so users would need to manually remove it. Also note that the removal will raise an exception if the runtime directory is a symbolic link presumably due to shutil.rmtree protecting against symbolic link attacks, so users should not be creating links for this directory.
  • Loading branch information
R1kaB3rN committed Jun 3, 2024
1 parent c81d3ed commit 4618ded
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions umu/umu_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ def _update_umu(
)
for file in local.glob(f"*{build_id}"):
runtime = file
log.debug("Runtime: %s", runtime.name)
break

if (
Expand Down Expand Up @@ -326,6 +327,8 @@ def _update_umu(
):
log.console(f"Updating {codename} to latest...")
_install_umu(json, thread_pool)
log.debug("Removing: %s", runtime)
rmtree(runtime.as_posix())
return
log.console(f"{codename} is up to date")

Expand Down

0 comments on commit 4618ded

Please sign in to comment.