Skip to content

Commit

Permalink
refactor: log update info once
Browse files Browse the repository at this point in the history
- umu-launcher was logging the Proton update message and assigning the same variables twice in the delta update path. Just keep the assignment operations to both the public and private mappings scoped to _get_delta
  • Loading branch information
R1kaB3rN committed Jan 9, 2025
1 parent 74b2432 commit 75f5c5f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions umu/umu_proton.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ def get_umu_proton(env: dict[str, str], session_pools: SessionPools) -> dict[str
tmpdirs: SessionCaches = (Path(tmp), Path(tmpcache))
compatdirs = (UMU_COMPAT, STEAM_COMPAT)
if _get_delta(env, UMU_COMPAT, patch, assets, session_pools) is env:
log.info("%s is up to date", os.environ["PROTONPATH"])
os.environ["PROTONPATH"] = str(
UMU_COMPAT.joinpath(os.environ["PROTONPATH"])
)
return env
if _get_latest(env, compatdirs, tmpdirs, assets, session_pools) is env:
return env
Expand Down Expand Up @@ -604,6 +600,12 @@ def _get_delta(
orig.rename(new)
log.debug("Update time (ns): %s", time.time_ns() - start)

# At this point, the update was successful. Assuming no bugs, this
# statement is expected to be incorrect if the user tampered with the build
log.info("%s is up to date", version)
os.environ["PROTONPATH"] = str(umu_compat.joinpath(version))
env["PROTONPATH"] = os.environ["PROTONPATH"]

return env


Expand Down

0 comments on commit 75f5c5f

Please sign in to comment.