Skip to content

Commit

Permalink
umu_proton: create symlink for all supported protons
Browse files Browse the repository at this point in the history
  • Loading branch information
R1kaB3rN committed Oct 3, 2024
1 parent cd8ccd7 commit af6ca5b
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions umu/umu_proton.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,6 @@ def _get_latest(


def _update_proton(
proton: str,
steam_compat: Path,
protons: list[Path],
thread_pool: ThreadPoolExecutor,
) -> None:
Expand All @@ -366,11 +364,8 @@ def _update_proton(
will be removed, so users should not be storing important files there.
"""
futures: list[Future] = []
steam_compat.joinpath("UMU-Latest").unlink(missing_ok=True)
steam_compat.joinpath("UMU-Latest").symlink_to(proton)
log.debug("Updating UMU-Proton")
log.debug("Previous builds: %s", protons)
log.debug("Linking UMU-Latest -> %s", proton)

if not protons:
return
Expand Down Expand Up @@ -417,9 +412,7 @@ def _install_proton(
for file in steam_compat.glob("*")
if file.name.startswith(("UMU-Proton", "ULWGL-Proton"))
]
future = thread_pool.submit(
_update_proton, proton, steam_compat, protons, thread_pool
)
future = thread_pool.submit(_update_proton, protons, thread_pool)

# Move downloaded file from tmpfs to cache to avoid high memory usage
log.debug("Moving: %s -> %s", archive_path, tmpdirs[1])
Expand All @@ -431,5 +424,9 @@ def _install_proton(
log.console(f"'{proton_path}' -> '{steam_compat}'")
move(proton_path, steam_compat)

steam_compat.joinpath("UMU-Latest").unlink(missing_ok=True)
steam_compat.joinpath("UMU-Latest").symlink_to(proton)
log.debug("Linking: UMU-Latest -> %s", proton)

if future:
future.result()

0 comments on commit af6ca5b

Please sign in to comment.