Skip to content

Commit 4618ded

Browse files
committed
umu_runtime: remove the old runtime after installing the latest
- 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.
1 parent c81d3ed commit 4618ded

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

umu/umu_runtime.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ def _update_umu(
264264
)
265265
for file in local.glob(f"*{build_id}"):
266266
runtime = file
267+
log.debug("Runtime: %s", runtime.name)
267268
break
268269

269270
if (
@@ -326,6 +327,8 @@ def _update_umu(
326327
):
327328
log.console(f"Updating {codename} to latest...")
328329
_install_umu(json, thread_pool)
330+
log.debug("Removing: %s", runtime)
331+
rmtree(runtime.as_posix())
329332
return
330333
log.console(f"{codename} is up to date")
331334

0 commit comments

Comments
 (0)