Skip to content

Commit

Permalink
fix: remove runtime variable directory each update (#214)
Browse files Browse the repository at this point in the history
* umu_runtime: remove variable dir each update

* umu_runtime: add comment

* tests: update e2e tests to account for variable dir

* tests: prefer chaining the umu-run commands
  • Loading branch information
R1kaB3rN authored Oct 9, 2024
1 parent 459ba8e commit cfe955f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/test_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ tar xaf SteamLinuxRuntime_sniper.tar.xz
mv SteamLinuxRuntime_sniper/* "$HOME/.local/share/umu"
mv "$HOME/.local/share/umu/_v2-entry-point" "$HOME/.local/share/umu/umu"

UMU_LOG=debug GAMEID=umu-0 "$HOME/.local/bin/umu-run" wineboot -u
# Perform a preflight step, where we ensure everything is in order and create '$HOME/.local/share/umu/var'
# Afterwards, run a 2nd time to perform the runtime update and ensure '$HOME/.local/share/umu/var' is removed
UMU_LOG=debug GAMEID=umu-0 UMU_RUNTIME_UPDATE=0 "$HOME/.local/bin/umu-run" wineboot -u && UMU_LOG=debug GAMEID=umu-0 "$HOME/.local/bin/umu-run" wineboot -u
9 changes: 9 additions & 0 deletions umu/umu_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ def _install_umu(

# Move the files to the correct location
source_dir: Path = Path(tmpcache, f"SteamLinuxRuntime_{codename}")
var: Path = UMU_LOCAL.joinpath("var")
log.debug("Source: %s", source_dir)
log.debug("Destination: %s", UMU_LOCAL)

Expand All @@ -170,6 +171,14 @@ def _install_umu(
]
)

if var.is_dir():
log.debug("Removing: %s", var)
# Remove the variable directory to avoid Steam Linux Runtime
# related errors when creating it. Supposedly, it only happens
# when going from umu-launcher 0.1-RC4 -> 1.1.1
# See https://github.com/Open-Wine-Components/umu-launcher/issues/213#issue-2576708738
thread_pool.submit(rmtree, str(var))

for future in futures:
future.result()

Expand Down

0 comments on commit cfe955f

Please sign in to comment.