Skip to content

Commit

Permalink
umu_proton: update format
Browse files Browse the repository at this point in the history
  • Loading branch information
R1kaB3rN committed Jan 2, 2025
1 parent 03b216e commit 8364576
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions umu/umu_proton.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,11 +391,7 @@ def _get_latest(

# Extract the archive then move the directory
_install_proton(tarball, session_caches, compat_tools)
except (
ValueError,
KeyboardInterrupt,
HTTPError,
) as e:
except (ValueError, KeyboardInterrupt, HTTPError) as e:
log.exception(e)
return None
except FileExistsError:
Expand Down Expand Up @@ -456,19 +452,15 @@ def _install_proton(
# $XDG_DATA_HOME/umu/compatibilitytools
if os.environ.get("PROTONPATH") in latest_candidates:
log.info(
"%s -> %s",
cache.joinpath(tarball.removesuffix(".tar.gz")),
umu_compat,
"%s -> %s", cache.joinpath(tarball.removesuffix(".tar.gz")), umu_compat
)
move(
cache.joinpath(tarball.removesuffix(".tar.gz")),
umu_compat / os.environ["PROTONPATH"],
)
else:
log.info(
"%s -> %s",
cache.joinpath(tarball.removesuffix(".tar.gz")),
steam_compat,
"%s -> %s", cache.joinpath(tarball.removesuffix(".tar.gz")), steam_compat
)
move(cache.joinpath(tarball.removesuffix(".tar.gz")), steam_compat)

Expand All @@ -485,8 +477,11 @@ def _get_delta(
"GE-Latest" if os.environ.get("PROTONPATH") == "GE-Latest" else "UMU-Latest"
)
proton: Path = umu_compat.joinpath(version)
cbor: ContentContainer
lockfile: str = f"{UMU_LOCAL}/compatibilitytools.d.lock"
cbor: ContentContainer

if not assets:
return None

if os.environ.get("PROTONPATH") not in {
ProtonVersion.GELatest.value,
Expand All @@ -495,9 +490,6 @@ def _get_delta(
log.debug("PROTONPATH not *-Latest, skipping")
return None

if not assets:
return None

if not patch:
log.debug("Received empty byte string for patch, skipping")
return None
Expand Down Expand Up @@ -541,7 +533,7 @@ def _get_delta(
# OWC maintainer forgot to add digest to whitelist, a different public key
# was accidentally used or patch was created by a 3rd party
log.error(
"Digest mismatched for public key '%s', skipping update",
"Digest mismatched for public key '%s', skipping",
cbor.get("public_key"),
)
return None
Expand All @@ -552,7 +544,7 @@ def _get_delta(
dumps(cbor["contents"], canonical=True),
cbor["signature"],
):
log.error("Digital signature verification failed, skipping update")
log.error("Digital signature verification failed, skipping")
return None

patchers: list[CustomPatcher | None] = []
Expand Down

0 comments on commit 8364576

Please sign in to comment.